diff --git a/GT_Modulsicht/GT Viewsicht.vpp b/GT_Modulsicht/GT Viewsicht.vpp new file mode 100644 index 0000000000000000000000000000000000000000..494d0d5a0b7294288d196763559bbc3ebad3f9ec Binary files /dev/null and b/GT_Modulsicht/GT Viewsicht.vpp differ diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/Button.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/Button.java new file mode 100644 index 0000000000000000000000000000000000000000..e9ceabd3210357040e9e5f12dad2b3fa604fa17d --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/Button.java @@ -0,0 +1,110 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.Texture; + + +/** + * Absftraqct Button-Class. + * TODO: Momentan hat jeder Button seinen eigenen Constructor, in dem über die main ein SpriteBatch generiert wird. Möglicher Weise ist es eleganter das in dieser Klasse zu tun und in den jeweiligen Konstruktoren nur die entsprechende Funktion aufzurufen + */ +public abstract class Button { + + protected int imageX; + protected int imageY; + protected int screenX; + protected int screenY; + protected int width; + protected int height; + protected Texture image_up; + protected Texture image_down; + protected Texture image_hover; + protected Texture image_disabled; + + protected boolean disabled; + protected boolean hover; + + + /** + * Changes the usability of the Button + * @param disabled + */ + public void setDisabled(boolean disabled) + { + this.disabled = disabled; + } + + + public void move(int x, int y) + { + imageX += x; + screenX += x; + imageY += y; + screenY += y; + } + + /** + * Sets Position of the Button on the Screen + * @param x horizontal Coordinate of the Button + * @param y vertikal Coordinate of the Button + */ + public void setPosition(int x, int y) + { + this.move(x - screenX, y - screenY); + } + + /** + * Sets Texture of the Button to the "hovered" Version of it + * @param texture texture of the hovered Button + */ + public void setHoverImage(Texture texture) + { + this.image_hover = texture; + } + + /** + * Sets Texture of the Button to the "disabled" Version of it + * @param texture texture of the disabled Button + */ + public void setDisabledImage(Texture texture) + { + this.image_disabled = texture; + } + + /** + * TODO not sure for what this one is. + * @param texture + */ + public void setDownImage(Texture texture) + { + this.image_down = texture; + } + + /** + * + * @param x + * @param y + * @return + */ + public boolean containsPoint(int x, int y) + { + return x >= screenX && x < screenX+width && y >= screenY && y < screenY+height; + } + + /** + * Sets Hovering-Effect for an Button + */ + public boolean isHovering(){ + int mouseX = Gdx.input.getX(); + int mouseY = Gdx.graphics.getHeight() - Gdx.input.getY(); + + return containsPoint(mouseX, mouseY); + } + + + /** + * Left-Click action of the Button. + */ + public abstract void leftClick(); + +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/AutofireButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/AutofireButton.java new file mode 100644 index 0000000000000000000000000000000000000000..9fed8d8816a738e917a0d9170abbb1ad2f4e29a7 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/AutofireButton.java @@ -0,0 +1,70 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons; + + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.Weapons.Weapon; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Ship.ShipView; + +/** + * Button to activate Autofire-Function during fights + */ +public class AutofireButton extends Button +{ + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + boolean down = false; + + /** + * the ui this button is on + */ + private ShipView ui; + + /** + * Constructor + * + * @param main - main class + * @param ui the ui this button is on + */ + public AutofireButton(Main main, ShipView ui) { + +// /** +// * Send data to server +// */ +// private void sendData(Packet data) { +// } +// +// /** +// * Receive data from server +// */ +// private Packet receiveData() { +// return null; + } + + public void leftClick() + { + down = !down; + } + + +} \ No newline at end of file diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/ContinueButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/ContinueButton.java new file mode 100644 index 0000000000000000000000000000000000000000..9cd99f2b65079657c5b852ecd87c4cea0a10702a --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/ContinueButton.java @@ -0,0 +1,56 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Options.OptionsUI; + +/** + * continue button for ingame options + */ +public class ContinueButton extends Button { + + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + boolean down = false; + + /** + * the options ui this button is on + */ + private OptionsUI ui; + + /** + * Left-Click action of the Button. + */ + @Override + public void leftClick() { + + } + + /** + * constructor + * @param main the main class + * @param ui the ui this is on + */ + public ContinueButton(Main main, OptionsUI ui) { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/CrewDismissButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/CrewDismissButton.java new file mode 100644 index 0000000000000000000000000000000000000000..a139d6e0b1fd29f5f967f1ae910951adb5f88b83 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/CrewDismissButton.java @@ -0,0 +1,50 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.Crew.Crew; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; + +/** + * Button for dismissing a Crew Member + */ +public class CrewDismissButton extends Button +{ + + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + private int crewID; + + /** + * Constructor + * + * @param main - main class + * @param crew the crew member + */ + public CrewDismissButton(Main main, int crew) { + } + + public void leftClick() + { + // dismiss crew + } +} + diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/DoorCloserButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/DoorCloserButton.java new file mode 100644 index 0000000000000000000000000000000000000000..e1b9de9f1126c6ea262887469bea7759ae9988d3 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/DoorCloserButton.java @@ -0,0 +1,73 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.Ship; +//import com.galaxytrucker.galaxytruckerreloaded.Model.ShipLayout.Section; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; + +/** + * Button for closing Door(s) of a Ship-Section + */ +public class DoorCloserButton extends Button +{ + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + //private System system; + private Ship ship; + //private Section section; + + /** + * Constructor + * + * @param main - main class + */ + public DoorCloserButton(Main main) { + } + +// /** +// * Send data to server +// */ +// private void sendData(Packet data) { +// } +// +// /** +// * Receive data from server +// */ +// private Packet receiveData() { +// return null; +// } + + /** + * Closes Door + */ + public void leftClick() + { +// for(Section section : system.getShip().getSection().values()) +// { +// for(Door door : section.getDoors()) +// { +// door.forceOpen = false; +// } +// } + } +} + diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/DoorOpenerButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/DoorOpenerButton.java new file mode 100644 index 0000000000000000000000000000000000000000..1165524a21dca7a7fe0d0541d61856e59a6be4b6 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/DoorOpenerButton.java @@ -0,0 +1,111 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.Ship; +//import com.galaxytrucker.galaxytruckerreloaded.Model.ShipLayout.Section; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; + +/** + * Button for opening the Door(s) of a Ship-Section + */ +public class DoorOpenerButton extends Button +{ + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + //private System system; + private Ship ship; + //private Section section; + + //private long lastClick = -1; + + /** + * Constructor + * + * @param main - main class + */ + public DoorOpenerButton(Main main) { + } + +// /** +// * Send data to server +// */ +// private void sendData(Packet data) { +// } +// +// /** +// * Receive data from server +// */ +// private Packet receiveData() { +// return null; +// } + + /** + * Makes an explicit Door passable + */ + public void leftClick() + { +// if(lastClick == -1) +// { +// lastClick = System.currentTimeMillis(); +// } +// else +// { +// Clock.log("" + (lastClick - System.currentTimeMillis())); +// if(System.currentTimeMillis() - lastClick < 100) +// { +// return; +// } +// else +// { +// lastClick = System.currentTimeMillis(); +// } +// } +// +// boolean changed = false; +// for(Room room : system.getShip().getRooms().values()) +// { +// for(Door door : room.getDoors()) +// { +// if(door.room2 != null) +// { +// if(door.forceOpen == false) +// { +// changed = true; +// } +// door.forceOpen = true; +// } +// } +// } +// Clock.log("test " + changed); +// +// if(changed == false) +// { +// for(Room room : system.getShip().getRooms().values()) +// { +// for(Door door : room.getDoors()) +// { +// door.forceOpen = true; +// } +// } +// } + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/EquipmentAndUpgradesMenu/EquipmentTabButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/EquipmentAndUpgradesMenu/EquipmentTabButton.java new file mode 100644 index 0000000000000000000000000000000000000000..65c558bf41a0134e726def17c64ef86e4d9fbb1b --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/EquipmentAndUpgradesMenu/EquipmentTabButton.java @@ -0,0 +1,49 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.EquipmentAndUpgradesMenu; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.Ship; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; + +/** + * Opens the Equipment-Tab in the Menue + */ +public class EquipmentTabButton extends Button +{ + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + /** + * Constructor + * + * @param main - main class + */ + public EquipmentTabButton(Main main) { + } + + + /** + * opens the Equipment-Tap Screen + */ + @Override + public void leftClick() + { + } +} \ No newline at end of file diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/EquipmentAndUpgradesMenu/UpgradesTabButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/EquipmentAndUpgradesMenu/UpgradesTabButton.java new file mode 100644 index 0000000000000000000000000000000000000000..976c78474ab64916a9182748624f856a8f521668 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/EquipmentAndUpgradesMenu/UpgradesTabButton.java @@ -0,0 +1,48 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.EquipmentAndUpgradesMenu; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; + +/** + * Opens the Upgrade-Tab in the Menue + */ +public class UpgradesTabButton extends Button +{ + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + /** + * Constructor + * @param main - main class + */ + public UpgradesTabButton(Main main) { + } + + /** + * opens the Upgrade-Tab-Screen + */ + @Override + public void leftClick() + { +// if(FTLView.instance().getScreen() instanceof SpaceScreen) +// ((SpaceScreen)FTLView.instance().getScreen()).openGUI(new UpgradeUI(FTLGame.instance().getPlayer())); + } +} \ No newline at end of file diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/EventPageButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/EventPageButton.java new file mode 100644 index 0000000000000000000000000000000000000000..26b091b1455ff05f553dec22aad5ac170bc95f64 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/EventPageButton.java @@ -0,0 +1,52 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Events.EventGUI; + +public class EventPageButton extends Button { + + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + boolean down = false; + + /** + * the ui the button is on + */ + private EventGUI eventgui; + + /** + * what happens when there is a left click on the button + */ + public void leftClick() {down=!down;} + + /** + * constructor + * + * @param main the main class + * + * @param eventgui the ui the button is on + */ + public EventPageButton(Main main, EventGUI eventgui) { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/InventoryCloseButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/InventoryCloseButton.java new file mode 100644 index 0000000000000000000000000000000000000000..060093f947eff44c7799ab44c7dbc4150547fdaa --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/InventoryCloseButton.java @@ -0,0 +1,65 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Events.ShopUI; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Inventory.InventoryUI; + +/** + * used to close the inventory + */ +public class InventoryCloseButton extends Button { + + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + boolean down = false; + + /** + * shop ui, if button on shop + * otherwise null + */ + private ShopUI shop; + + /** + * the inventory ui, if button on inventory + * otherwise null + */ + private InventoryUI inventory; + + /** + * Left-Click action of the Button. + */ + @Override + public void leftClick() { + + } + + /** + * constructor + * @param main the main class + * @param ui the shop ui this is on, or null + * @param inventory the inventory ui this is on, or null + */ + public InventoryCloseButton(Main main, ShopUI ui, InventoryUI inventory) { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/MainMenuButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/MainMenuButton.java new file mode 100644 index 0000000000000000000000000000000000000000..862c0eec5fa736ce06135f39d9c806c5de81e564 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/MainMenuButton.java @@ -0,0 +1,51 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Events.GameOver; + +/*** + * button used to return to the main menu + */ +public class MainMenuButton extends Button { + + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + boolean down = false; + + + /** + * Left-Click action of the Button. opens the main menu screen + */ + @Override + public void leftClick() { + + } + + /** + * constructor + * @param main the main class + */ + public MainMenuButton(Main main) { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/MoveButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/MoveButton.java new file mode 100644 index 0000000000000000000000000000000000000000..3b62e99ea33aa219378a9a2a7094fabdd58be03d --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/MoveButton.java @@ -0,0 +1,56 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Ship.ShipView; + +/** + * button used to move the ship. upper middle corner, opens the map + */ +public class MoveButton extends Button { + + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + boolean down = false; + + /** + * the ui this button is on + */ + private ShipView ui; + + /** + * Left-Click action of the Button. + */ + @Override + public void leftClick() { + + } + + /** + * constructor + * @param main the main class + * @param ui the ui this button is on + */ + public MoveButton(Main main, ShipView ui) { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/ShipButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/ShipButton.java new file mode 100644 index 0000000000000000000000000000000000000000..eb6cc83ea6f722c4e9938738dec79fd407fe9260 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/ShipButton.java @@ -0,0 +1,56 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.Ship; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Ship.ShipView; + +/** + * Button for opening the Ship-Interface + * */ +public class ShipButton extends Button +{ + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + /** + * the ui this button is on + */ + private ShipView ui; + + /** + * Constructor + * + * @param main - main class + * @param ui the ui this button is on + */ + public ShipButton(Main main, ShipView ui) { + } + + + /** + * opens the Ship-Screen of the cureent Ship + */ + public void leftClick() + { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/ShopBuyButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/ShopBuyButton.java new file mode 100644 index 0000000000000000000000000000000000000000..93f732b35f2ae7a45e86c9271555f4af67322a7c --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/ShopBuyButton.java @@ -0,0 +1,61 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Events.ShopUI; + +/** + * button used to buy something in the shop + */ +public class ShopBuyButton extends Button { + + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + boolean down = false; + + /** + * the item this button belongs to + * index of list in shopui + */ + private int item; + + /** + * the ui this button is on + */ + private ShopUI shop; + + /** + * Constructor + * + * @param main - main class + * @param item the item + * @param ui the ui this button is on + */ + public ShopBuyButton(Main main, int item, ShopUI ui) { + + } + + public void leftClick() + { + down = !down; + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/SystemButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/SystemButton.java new file mode 100644 index 0000000000000000000000000000000000000000..51029a3b41648cfaeac84d2933c26013a566e55c --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/SystemButton.java @@ -0,0 +1,148 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.ShipInformation.SubsystemUI; + +/** + * Button for regulation of (Sub)-System energie supplyment + */ +public class SystemButton extends Button +{ + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + private Texture image_off; + private Texture image_hover_off; + + Texture glow; + + /** + * the ui this button belongs to + */ + private SubsystemUI ui; + + /** + * Constructor + * + * @param main - main class + * @param ui the ui this button belongs to + */ + public SystemButton(Main main, SubsystemUI ui) { + } + + public void setGlowTexture(Texture glow) + { + this.glow = glow; + } + + public void setOffTextures(Texture image_off, Texture image_hover_off) + { + this.image_off = image_off; + this.image_hover_off = image_hover_off; + } + + + /** + * decrease the Energie provided for a System + */ + public void rightClick() + { +// int power = -1; +// if(system instanceof ShieldSystem) +// power = -2; +// +// if(system instanceof WeaponSystem) +// { +// WeaponSystem weaponSystem = (WeaponSystem)system; +// for(int i = 3; i >= 0; i--) +// { +// if(weaponSystem.getWeapon(i) != null && weaponSystem.getWeapon(i).isPowered()) +// { +// int prevPower = system.getPower(); +// weaponSystem.powerDownWeapon(i); +// if(prevPower != system.getPower()) +// { +// Sounds.playSound("buttonOff"); +// } +// break; +// } +// } +// } +// else +// { +// int prevPower = system.getPower(); +// system.addPower(power); +// if(prevPower != system.getPower()) +// { +// Sounds.playSound("buttonOff"); +// } +// } + } + + /** + * increases the Energie provided for a System + */ + @Override + public void leftClick(){ +// { +// int power = 1; +// if(system instanceof ShieldSystem) +// power = 2; +// +// if(system instanceof WeaponSystem) +// { +// WeaponSystem weaponSystem = (WeaponSystem)system; +// for(int i = 0; i < 4; i++) +// { +// if(!weaponSystem.getWeapon(i).isPowered()) +// { +// int prevPower = system.getPower(); +// weaponSystem.powerOnWeapon(i); +// if(prevPower != system.getPower()) +// { +// Sounds.playSound("buttonOn"); +// } +// else +// { +// Sounds.playSound("buttonFail"); +// } +// break; +// } +// } +// } +// else +// { +// int prevPower = system.getPower(); +// system.addPower(power); +// if(prevPower != system.getPower()) +// { +// Sounds.playSound("buttonOn"); +// } +// else +// { +// Sounds.playSound("buttonFail"); +// } +// } +// } +} +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/WeaponActivateButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/WeaponActivateButton.java new file mode 100644 index 0000000000000000000000000000000000000000..40ea4db5ccaa974341a0e36f78875825998454e5 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/WeaponActivateButton.java @@ -0,0 +1,58 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.ShipInformation.WeaponUI; + +import java.io.BufferedWriter; + +/** + * button used to activate/deactivate weapon + */ +public class WeaponActivateButton extends Button { + + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + boolean down = false; + + /** + * the ui this button belongs to + */ + private WeaponUI ui; + + /** + * Left-Click action of the Button. + */ + @Override + public void leftClick() { + + } + + /** + * constructor + * @param main the main class + * @param ui the ui this button belongs to + */ + public WeaponActivateButton(Main main, WeaponUI ui) { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/DifficultyButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/DifficultyButton.java new file mode 100644 index 0000000000000000000000000000000000000000..c1d9672a1a95f091384737d156b201a470dcc550 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/DifficultyButton.java @@ -0,0 +1,60 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.MenuButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.Screen.ShipSelector; + +/** + * Button for setting the degree of diffiulty + */ +public class DifficultyButton extends Button +{ + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + private int difficulty; + + /** + * the screen this button is on + */ + private ShipSelector screen; + + /** + * Constructor + * + * @param main - main class + * @param difficulty the difficulty this button represents + * @param screen the screen this button is on + */ + public DifficultyButton(Main main, int difficulty, ShipSelector screen) { + } + + /** + * Sets difficutly to a specific level + */ + @Override + public void leftClick() + { + // setDifficulty(difficulty); + } + +} + diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/LoginButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/LoginButton.java new file mode 100644 index 0000000000000000000000000000000000000000..4b971f27a938889d7d002cac0bcbac218d576cf2 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/LoginButton.java @@ -0,0 +1,56 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.MenuButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.Screen.LoginScreen; +import sun.rmi.runtime.Log; + +/** + * the login button for the login screen + */ +public class LoginButton extends Button { + + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + /** + * the screen from which this was called + */ + private LoginScreen screen; + + /** + * Left-Click action of the Button. + * calls method in the screen + */ + @Override + public void leftClick() { + + } + + /** + * the constructor + * @param main the main class + * @param screen the login screen this button belongs to + */ + public LoginButton(Main main, LoginScreen screen) { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/NewGameButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/NewGameButton.java new file mode 100644 index 0000000000000000000000000000000000000000..a2466e8bc49c759d9424c88feef5b20c112e3878 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/NewGameButton.java @@ -0,0 +1,66 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.MenuButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.Screen.MainMenu; + +/** + * Starts a new Game + */ +public class NewGameButton extends Button +{ + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + /** + * the screen this button is on + */ + private MainMenu screen; + + /** + * Constructor + * + * @param main - main class + * @param screen the screen this button is on + */ + public NewGameButton(Main main, MainMenu screen) { + } + +// /** +// * Send data to server +// */ +// private void sendData(Packet data) { +// } +// +// /** +// * Receive data from server +// */ +// private Packet receiveData() { +// return null; +// } + + /** + * Creats new Game + */ + public void leftClick() + { + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/QuitButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/QuitButton.java new file mode 100644 index 0000000000000000000000000000000000000000..97604472d573e2b05fd20b4ab38894d33e259684 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/QuitButton.java @@ -0,0 +1,69 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.MenuButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.Screen.MainMenu; + +/** + * Ends the Game + */ +public class QuitButton extends Button +{ + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + /** + * the screen this button is on + */ + private MainMenu screen; + + /** + * Constructor + * + * @param main - main class + * @param screen the screen this button is on + */ + public QuitButton(Main main, MainMenu screen) { + } + +// /** +// * Send data to server +// */ +// private void sendData(Packet data) { +// } +// +// /** +// * Receive data from server +// */ +// private Packet receiveData() { +// return null; +// } + + /** + * Ends the Game + */ + @Override + public void leftClick() + { + System.exit(0); + } +} + diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/ShipSelectButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/ShipSelectButton.java new file mode 100644 index 0000000000000000000000000000000000000000..8f8916bdfa98057d11582e0248ed47ea29cd83e0 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/ShipSelectButton.java @@ -0,0 +1,60 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.MenuButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.Screen.ShipSelector; + +/** + * the button representing one ship in the ship selector + */ +public class ShipSelectButton extends Button { + + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + /** + * the ship this button represents in the ship selector + */ + private int ship; + + /** + * the screen this button is on + */ + private ShipSelector screen; + + /** + * Left-Click action of the Button. + */ + @Override + public void leftClick() { + + } + + /** + * constructor + * @param main the main class + * @param ship the ship, (index of ship in list in shipselector) + * @param screen the screen this button is on + */ + public ShipSelectButton(Main main, int ship, ShipSelector screen) { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/SinglePlayerButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/SinglePlayerButton.java new file mode 100644 index 0000000000000000000000000000000000000000..074080462523542726b6d1962d675c6ce058abc1 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/SinglePlayerButton.java @@ -0,0 +1,60 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.MenuButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.Screen.ShipSelector; + +/** + * button to choose single player in the ship selector + */ +public class SinglePlayerButton extends Button { + + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + /** + * the screen this button is on + */ + private ShipSelector screen; + + /** + * whether or not it is single player + */ + private boolean singlePlayer; + + /** + * Left-Click action of the Button. + */ + @Override + public void leftClick() { + + } + + /** + * constructor + * + * @param screen the screen this button is on + * @param main the main class + */ + public SinglePlayerButton(Main main, ShipSelector screen) { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/StartButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/StartButton.java new file mode 100644 index 0000000000000000000000000000000000000000..eb9e3328a43c69c04695bfec224b86f182da49f8 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/MenuButtons/StartButton.java @@ -0,0 +1,69 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.MenuButtons; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.Button; +import com.galaxytrucker.galaxytruckerreloaded.View.Screen.MainMenu; + +/** + * Starts a new Game + */ +public class StartButton extends Button +{ + /** + * Sprite batch + */ + private SpriteBatch batch; + /** + * Orthographic camera + */ + private OrthographicCamera camera; + /** + * Background + */ + private Texture background; + /** + * Click sound effect + */ + private Sound clickSound; + + /** + * the screen this button is on + */ + private MainMenu screen; + + + /** + * Constructor + * + * @param main - main class + * @param screen the screen this button is on + */ + public StartButton(Main main, MainMenu screen) { + } + +// /** +// * Send data to server +// */ +// private void sendData(Packet data) { +// } +// +// /** +// * Receive data from server +// */ +// private Packet receiveData() { +// return null; +// } + + /** + * Creates s a new Instance of PLayer an an new Ship + */ + public void leftClick() + { + // FTLGame.instance().setPlayer(hanger.getShip()); + // FTLView.instance().setScreen(new SpaceScreen()); + } +} \ No newline at end of file diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/GamePlay.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/GamePlay.java index 52efedd5cdd3ae616a62c404a60c6d513aa985f1..2b6bc82049a9e714811e1373cd20e6c848c2a9c7 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/GamePlay.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/GamePlay.java @@ -7,7 +7,10 @@ import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Inventory.InventoryUI; import com.galaxytrucker.galaxytruckerreloaded.View.UI.Map.MapUI; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Options.OptionsUI; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Ship.ShipView; /** * Main game screen @@ -49,6 +52,12 @@ public class GamePlay implements Screen { */ private MapUI gameMap; + /** + * ship of the player + */ + private ShipView player; + + @Override public void show() { diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/LoginScreen.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/LoginScreen.java index 03930b4c6b903143f69b58bd8e62dc7a6b615910..1c5fac7654fd17cde62c123826d91520c3a94f16 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/LoginScreen.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/LoginScreen.java @@ -9,6 +9,7 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; import com.badlogic.gdx.scenes.scene2d.ui.TextField; import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.MenuButtons.LoginButton; /** * Login Screen @@ -36,14 +37,9 @@ public class LoginScreen implements Screen { private TextField username; /** - * Login button + * the login button */ - private ImageButton loginButton; - - /** - * Login button texture - */ - private Texture loginButtonTexture; + private LoginButton loginButton; /** * Looping music track @@ -90,6 +86,13 @@ public class LoginScreen implements Screen { } + /** + * login method, called by the button + */ + public void login() { + + } + /** * Constructor * diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/MainMenu.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/MainMenu.java index 47de18aae6d29f120ab25614d9f7befcdc1eeb47..a1bfe5513292d215d4201468c7fb4bdbb0e94aea 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/MainMenu.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/MainMenu.java @@ -8,6 +8,7 @@ import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.MenuButtons.*; /** * Main menu screen @@ -30,44 +31,19 @@ public class MainMenu implements Screen { private Texture background; /** - * SinglePlayer button + * new game button. leads to shipselector */ - private ImageButton singlePlayerButton; + private NewGameButton newGame; /** - * SinglePlayer button texture + * start game button. continues old game */ - private Texture singlePlayerButtonTexture; + private StartButton startGame; /** - * MultiPlayer button + * quit button */ - private ImageButton multiPlayerButton; - - /** - * MultiPlayer button texture - */ - private Texture multiPlayerButtonTexture; - - /** - * Options button - */ - private ImageButton optionsButton; - - /** - * Option button texture - */ - private Texture optionsButtonTexture; - - /** - * Quit button - */ - private ImageButton quitButton; - - /** - * Quit button texture - */ - private ImageButton quitButtonTexture; + private QuitButton quitButton; /** * Looping music track @@ -114,6 +90,30 @@ public class MainMenu implements Screen { } + /** + * starts a new game. + * called by button + */ + public void newGame() { + + } + + /** + * resumes the existing game. + * called by button + */ + public void resumeGame() { + + } + + /** + * quits. + * called by button + */ + public void quit() { + + } + /** Constructor * @param main - main class */ public MainMenu(Main main){} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/ShipSelector.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/ShipSelector.java index 6df16eabe36d950d938520f7d535394f02516158..bd669ddaebd0283bbcf794cf4070d2e06b584361 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/ShipSelector.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/ShipSelector.java @@ -6,7 +6,11 @@ import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.scenes.scene2d.ui.List; import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.MenuButtons.DifficultyButton; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.MenuButtons.ShipSelectButton; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.MenuButtons.SinglePlayerButton; /** * Ship selector screen when creating new game @@ -28,6 +32,26 @@ public class ShipSelector implements Screen { */ private Texture background; + /** + * the textures of the ships to choose from + */ + private List<Texture> ships; + + /** + * the buttons for the ships + */ + private List<ShipSelectButton> shipButtons; + + /** + * difficulty buttons (easy, medium, hard) + */ + private List<DifficultyButton> difficulties; + + /** + * button to choose single player. Otherwise, it is multiplayer + */ + private SinglePlayerButton singlePlayerButton; + /** * Looping music */ @@ -73,7 +97,31 @@ public class ShipSelector implements Screen { } - /** Constructor + /** + * to set the difficulty. called by button + * @param difficulty the difficulty + */ + public void setDifficulty(int difficulty) { + + } + + /** + * the ship is selected + * @param ship the index of the ship in the list of possible ships + */ + public void setShip(int ship) { + + } + + /** + * sets whether or not singleplayer. called by button + * @param single singleplayer = true + */ + public void setSinglePlayer(boolean single) { + + } + + /** Constructor TODO wie werden die schiffe dargestellt * @param main - main class */ public ShipSelector(Main main){} } diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/EnemyShipInfo/EnemyHullUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/EnemyShipInfo/EnemyHullUI.java new file mode 100644 index 0000000000000000000000000000000000000000..d9910d678464dc20392d81dbd1821839ab2316d6 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/EnemyShipInfo/EnemyHullUI.java @@ -0,0 +1,74 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.EnemyShipInfo; + +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.scenes.scene2d.ui.List; +import com.galaxytrucker.galaxytruckerreloaded.Main; + +public class EnemyHullUI { + + /** + * SpriteBatch + */ + private SpriteBatch batch; + + /** + * Orthographic camera + */ + private OrthographicCamera camera; + + /** + * the texture for the background + */ + private Texture HullBackground; + + /** + * the textures to display the current status of the hull + */ + private List<Texture> hullStatusTextures; + + + /** + * the status needs to be updated + * @param status the new status + */ + public void hullStatusUpdate(int status) { + + } + + /** + * Setup called after initialisation + */ + private void setup() { + } + + /** + * show the enemy hull ui + */ + public void showEnemyHullUI() { + + } + + /** + * hide the enemy hull ui + */ + public void hideEnemyHullUI() { + + } + + /** + * dispose of the enemy hull UI + */ + public void disposeEnemyHullUI() { + + } + + /** + * constructor + * @param main the main class + */ + public EnemyHullUI(Main main) { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/EnemyShipInfo/EnemyHullUI.java~RasmusAaron b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/EnemyShipInfo/EnemyHullUI.java~RasmusAaron new file mode 100644 index 0000000000000000000000000000000000000000..d9910d678464dc20392d81dbd1821839ab2316d6 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/EnemyShipInfo/EnemyHullUI.java~RasmusAaron @@ -0,0 +1,74 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.EnemyShipInfo; + +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.scenes.scene2d.ui.List; +import com.galaxytrucker.galaxytruckerreloaded.Main; + +public class EnemyHullUI { + + /** + * SpriteBatch + */ + private SpriteBatch batch; + + /** + * Orthographic camera + */ + private OrthographicCamera camera; + + /** + * the texture for the background + */ + private Texture HullBackground; + + /** + * the textures to display the current status of the hull + */ + private List<Texture> hullStatusTextures; + + + /** + * the status needs to be updated + * @param status the new status + */ + public void hullStatusUpdate(int status) { + + } + + /** + * Setup called after initialisation + */ + private void setup() { + } + + /** + * show the enemy hull ui + */ + public void showEnemyHullUI() { + + } + + /** + * hide the enemy hull ui + */ + public void hideEnemyHullUI() { + + } + + /** + * dispose of the enemy hull UI + */ + public void disposeEnemyHullUI() { + + } + + /** + * constructor + * @param main the main class + */ + public EnemyHullUI(Main main) { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/EnemyShipInfo/EnemySystemUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/EnemyShipInfo/EnemySystemUI.java new file mode 100644 index 0000000000000000000000000000000000000000..6d5974beb2b2b201a19e2b136300d8c8ff1cc5a7 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/EnemyShipInfo/EnemySystemUI.java @@ -0,0 +1,69 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.EnemyShipInfo; + +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.scenes.scene2d.ui.List; +import com.galaxytrucker.galaxytruckerreloaded.Main; + +public class EnemySystemUI { + /** + * SpriteBatch + */ + private SpriteBatch batch; + + /** + * Orthographic camera + */ + private OrthographicCamera camera; + + /** + * the textures to display the status of a system + */ + private List<Texture> systemStatus; + + //TODO a way to identify which system this is representing + + /** + * the status of the system changed + * @param damage the current amount of damage to the system + */ + public void statusChange(int damage) { + + } + + /** + * Setup called after initialisation + */ + private void setup() { + } + + /** + * show the enemy system ui + */ + public void showEnemySystemUI() { + + } + + /** + * hide the enemy system ui + */ + public void hideEnemySystemUI() { + + } + + /** + * dispose of the enemy system UI + */ + public void disposeEnemySystemUI() { + + } + + /** + * the constructor + * @param main the main class + */ + public EnemySystemUI(Main main) { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/EventGUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/EventGUI.java index 2558431a9cb964517b8cb52547941471819550fd..c0dedb5e74b15ca511363a92f21f17a21260f178 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/EventGUI.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/EventGUI.java @@ -5,9 +5,13 @@ import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.scenes.scene2d.ui.List; import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.Planet.PlanetEvent; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.EventPageButton; /** * Shows an event + * + * dialogue window for the events that can occur at a planet */ public class EventGUI { @@ -31,11 +35,25 @@ public class EventGUI { */ private EventPage firstPage; + /** + * what kind of event it is + */ + private PlanetEvent event; + + /** + * button to click on for next page + * + * if new page is openend, it is taken out of the list + * therefore, the next is always the front of the list + */ + private EventPageButton nextPage; + /** * Event background texture */ private Texture backgroundTexture; + /** * Setup called after initialisation */ @@ -63,15 +81,34 @@ public class EventGUI { /** * Switch event page * if there is no next page hide the event gui + * possibly open Shop ui, if the event is a shop, or start fight + * + * called by button */ private void nextPage() { } + /** + * starts a fight, if the event is a fight + */ + private void startFight() { + + } + + /** + * opens a shop, if the event is a shop + */ + private void openShop() { + + } + /** * Constructor * * @param main - main class object for SpriteBatch + * @param event what kind of event it is + * */ - public EventGUI(Main main) { + public EventGUI(Main main, PlanetEvent event) { } } diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/EventPage.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/EventPage.java index 72cb2e12b16e39390519f75fed48139adb179f4b..b161417f95f230ca9aeb7b2590571081c8f1e771 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/EventPage.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/EventPage.java @@ -6,6 +6,7 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; import com.badlogic.gdx.scenes.scene2d.ui.List; import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.EventPageButton; /** Includes all content shown on a single event page */ public class EventPage { @@ -25,15 +26,6 @@ public class EventPage { */ private List<Texture> drawables; - /** - * Next page button - */ - private ImageButton nextPageButton; - - /** - * Next page button texture - */ - private Texture nextPageButtonTexture; /** * Setup called after initialisation @@ -64,7 +56,9 @@ public class EventPage { * Constructor * * @param main - the main class object + * @param draw the drawables on this page + * @param text the text displayed on this page */ - public EventPage(Main main) { + public EventPage(Main main, List<Texture> draw, String text) { } } diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/GameOver.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/GameOver.java index 4543eb4ea1220f80826e23802307ebe3e26dfb24..470ec9daa852ffa5c15eb1e5050e70735ea7ab35 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/GameOver.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/GameOver.java @@ -3,7 +3,11 @@ package com.galaxytrucker.galaxytruckerreloaded.View.UI.Events; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.MainMenuButton; +/** + * view for the event that the player has lost or won the game + */ public class GameOver { /** @@ -12,14 +16,14 @@ public class GameOver { private Texture gameOverTexture; /** - * Main menu button + * Game won texture */ - private ImageButton mainMenuButton; + private Texture gameWonTexture; /** - * Main menu button texture + * button to main menu */ - private Texture mainMenuButtonTexture; + private MainMenuButton menuButton; /** * Setup called after initialisation diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/ShopUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/ShopUI.java new file mode 100644 index 0000000000000000000000000000000000000000..cb73080f3ce54265af8f5683ecfd10695371cf84 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/ShopUI.java @@ -0,0 +1,87 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.Events; + +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.scenes.scene2d.ui.List; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.InventoryCloseButton; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.ShopBuyButton; + + +/** + * UI for the case that an event is a shop opportunity + * + * called in the method openShop in eventGUI + * + */ +public class ShopUI { + + /** + * SpriteBatch + */ + private SpriteBatch batch; + + /** + * Orthographic camera + */ + private OrthographicCamera camera; + + /** + * to close the shop + */ + private InventoryCloseButton closeButton; + + /** + * list of textures to display stuff. each texture gets one button + */ + private List<Texture> textures; + + /** + * buttons to buy stuff, set up in setup + */ + private List<ShopBuyButton> buttons; + + /** + * Setup called after initialisation + */ + private void setup() { + } + + /** + * Show the shop ui + */ + public void showShopUI() { + } + + /** + * Hide the shop ui + */ + public void hideShopUI() { + } + + /** + * Dispose shop ui + */ + public void disposeShopUI() { + } + + /** + * an item is bought + * called by button + * @param item the item (index in the list) + */ + public void buy(int item) { + + } + + + /** + * constructor + * @param main the main class + * TODO wie werden hier die objekte die zum verkauf stehen übergeben? + */ + public ShopUI(Main main) { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventoryCrewSlotUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventoryCrewSlotUI.java new file mode 100644 index 0000000000000000000000000000000000000000..a01a97d94a81fea17b4dc69a5a5ce1c66e75eaa6 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventoryCrewSlotUI.java @@ -0,0 +1,68 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.Inventory; + +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.scenes.scene2d.ui.List; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.Crew.Crew; + +/** + * to represent a crew member in the inventory + */ +public class InventoryCrewSlotUI extends InventorySlotUI { + + /** + * the texture + */ + private Texture crewTexture; + + /** + * the name of the crew member + */ + private String name; + + /** + * the health of the crew member + */ + private int health; + + /** + * the maximum health of the crew member + */ + private int maxhealth; + + /** + * the textures to display the health status + */ + private List<Texture> healthStatus; + + /** + * show the ui + */ + public void showInventorySlotUI() { + + } + + /** + * Hide inventory slot ui + */ + public void hideInventorySlotUI() { + + } + + /** + * Dispose inventory slot ui + */ + @Override + public void disposeInventorySlotUI() { + + } + + /** + * Constructor + * + * @param main - main class + */ + public InventoryCrewSlotUI(Main main, Crew crew) { + super(main); + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventoryIntSlotUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventoryIntSlotUI.java new file mode 100644 index 0000000000000000000000000000000000000000..457cefef746dd644ac1c44d69650699e01314d2f --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventoryIntSlotUI.java @@ -0,0 +1,55 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.Inventory; + +import com.badlogic.gdx.graphics.Texture; +import com.galaxytrucker.galaxytruckerreloaded.Main; + +public class InventoryIntSlotUI extends InventorySlotUI { + + /** + * the value of the thing + */ + private int value; + + /** + * the texture + */ + private Texture texture; + + /** + * the text explaining what this inventory slot represents + */ + private String text; + + /** + * show the ui + */ + @Override + public void showInventorySlotUI() { + + } + + /** + * Hide inventory slot ui + */ + @Override + public void hideInventorySlotUI() { + + } + + /** + * Dispose inventory slot ui + */ + @Override + public void disposeInventorySlotUI() { + + } + + /** + * Constructor + * + * @param main - main class + */ + public InventoryIntSlotUI(Main main, int value) { + super(main); + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventorySlotUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventorySlotUI.java index 1b56cdce201f8fe644c79d82b4f03a4a45ccbf7d..99397262611de9bcb326f65bb3e0c312758d7cdc 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventorySlotUI.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventorySlotUI.java @@ -5,7 +5,7 @@ import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.galaxytrucker.galaxytruckerreloaded.Main; -public class InventorySlotUI { +public abstract class InventorySlotUI { /** * Sprite batch for rendering @@ -32,29 +32,20 @@ public class InventorySlotUI { */ private Texture inventorySlotTexture; - /** - * Setup called after initialisation - */ - private void setup() { - } - /** * show the ui */ - public void showInventorySlotUI() { - } + public abstract void showInventorySlotUI(); /** * Hide inventory slot ui */ - public void hideInventorySlotUI() { - } + public abstract void hideInventorySlotUI(); /** * Dispose inventory slot ui */ - public void disposeInventorySlotUI() { - } + public abstract void disposeInventorySlotUI(); /** * Constructor diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventoryUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventoryUI.java index 75f7dbc8d9f84908c2e9dc87a18841fc60c088ec..c10f9f4e8a9990dbbf874da00a91b8fd54438b85 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventoryUI.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventoryUI.java @@ -6,6 +6,10 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; import com.badlogic.gdx.scenes.scene2d.ui.List; import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.Crew.Crew; +import com.galaxytrucker.galaxytruckerreloaded.Model.Ship; +import com.galaxytrucker.galaxytruckerreloaded.Model.Weapons.Weapon; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.InventoryCloseButton; public class InventoryUI { @@ -30,17 +34,14 @@ public class InventoryUI { private List<InventorySlotUI> slots; /** - * Close inventory button + * button to close inventory */ - private ImageButton closeInventoryButton; - - /** - * Close inventory button texture - */ - private Texture closeInventoryButtonTexture; + private InventoryCloseButton closeButton; /** * setup called after initialisation + * + * here the inventory slots are initialised for fuel, missiles, crew, weapons, and money */ private void setup() { } @@ -63,11 +64,15 @@ public class InventoryUI { public void disposeInventoryUI() { } + /** * Constructor * * @param main - main class + * @param crew the crew members + * @param weapons the weapons + * @param integerValues the integer values to be displayed for a ship */ - public InventoryUI(Main main) { + public InventoryUI(Main main, List<Crew> crew, List<Weapon> weapons, List<Integer> integerValues) { } } diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventoryWeaponSlotUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventoryWeaponSlotUI.java new file mode 100644 index 0000000000000000000000000000000000000000..3dd1b12501e90c50779fb86bd30faee7814a03dc --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventoryWeaponSlotUI.java @@ -0,0 +1,72 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.Inventory; + +import com.badlogic.gdx.graphics.Texture; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.Weapons.Weapon; + +public class InventoryWeaponSlotUI extends InventorySlotUI { + + /** + * the texture for the weapon + */ + private Texture weaponTexture; + + /** Weapon damage */ + private int damage; + + /** Weapon coolDown */ + private int cooldown; + + /** Weapon energy */ + private int energy; + + private int missileCost; + private float dropchance; + private int crewdamage; + /** + * How many projectiles are fired per burst + */ + private int burst; + private float precision; + + /** + * show the ui + */ + @Override + public void showInventorySlotUI() { + + } + + /** + * Hide inventory slot ui + */ + @Override + public void hideInventorySlotUI() { + + } + + /** + * Dispose inventory slot ui + */ + @Override + public void disposeInventorySlotUI() { + + } + + /** + * Setup called after initialisation + */ + private void setup() + { + + } + + /** + * constructor + * @param main the main class + * @param weapon the weapon to be displayed + */ + public InventoryWeaponSlotUI(Main main, Weapon weapon) { + super(main); + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Map/MapUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Map/MapUI.java index 3670346c158661aa02447567bbc08c0c6e7f2521..a184108258c7d767e2a07eba31fa27f95201ff8f 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Map/MapUI.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Map/MapUI.java @@ -16,6 +16,7 @@ public class MapUI { */ private Texture mapTexture; + /** * Setup called after initialisation */ @@ -42,7 +43,7 @@ public class MapUI { /** * Constructor - * + * TODO die map hier übergeben in irgendeiner form, evtl attribute hinzufügen * @param main - main class */ public MapUI(Main main) { diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Options/OptionsUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Options/OptionsUI.java index 95cb3ab9c53072884a33cf235fffea8d75a09a4a..e0b97ed0e8b4348e5fb946945123dbd8175c7377 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Options/OptionsUI.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Options/OptionsUI.java @@ -5,6 +5,8 @@ import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.ContinueButton; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.MainMenuButton; /** * Ingame options UI @@ -27,34 +29,14 @@ public class OptionsUI { private Texture optionsBackgroundTexture; /** - * Continue button + * continue button */ - private ImageButton continueButton; + private ContinueButton continueButton; /** - * Continue button image + * main menu button */ - private Texture continueButtonTexture; - - /** - * Main Menu button - */ - private ImageButton mainMenuButton; - - /** - * Main Menu button texture - */ - private Texture mainMenuButtonTexture; - - /** - * Quit button - */ - private ImageButton quitButton; - - /** - * Quit button texture - */ - private Texture quitButtonTexture; + private MainMenuButton mainMenuButton; /** * Setup called after initialisation @@ -86,6 +68,6 @@ public class OptionsUI { * @param main - main class */ public OptionsUI(Main main) { - setup(); + } } diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Ship/AbstractShip.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Ship/AbstractShip.java new file mode 100644 index 0000000000000000000000000000000000000000..e26a4675799c29e501a58fb0b9fd6c4f4e1d39d0 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Ship/AbstractShip.java @@ -0,0 +1,71 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.Ship; + +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.scenes.scene2d.ui.List; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.Ship; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.ShipInformation.RoomUI; + +public abstract class AbstractShip { + + /** + * SpriteBatch + */ + private SpriteBatch batch; + + /** + * Orthographic camera + */ + private OrthographicCamera camera; + + /** + * HP + */ + private int hp; + + /** + * Shields + */ + private int shields; + + /** + * the rooms of the ship + */ + private List<RoomUI> rooms; + + /** + * show the ship + */ + public abstract void showShipView(); + + /** + * hide the ship + */ + public abstract void hideShipView(); + + /** + * dispose of ship + */ + public abstract void disposeShipView(); + + /** + * update of the hull status (hp) + * @param hpvalue new status + */ + public abstract void hullStatusUpdate(int hpvalue); + + /** + * shield status update + * @param shieldvalue new status + */ + public abstract void shieldStatusUpdate(int shieldvalue); + + /** + * Constructor + * + * @param main - the main class for SpriteBatch + */ + public AbstractShip(Main main, Ship ship) { + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Ship/EnemyShip.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Ship/EnemyShip.java new file mode 100644 index 0000000000000000000000000000000000000000..8ae2709df594a1911363443e4bd264e0a3e21887 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Ship/EnemyShip.java @@ -0,0 +1,111 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.Ship; + +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.scenes.scene2d.ui.List; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.Ship; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.EnemyShipInfo.EnemyHullUI; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.EnemyShipInfo.EnemySystemUI; + +public class EnemyShip extends AbstractShip { + + /** + * background of this enemy ship + */ + private Texture enemyBackground; + + /** + * the uis of the systems belonging to the enemy ship + */ + private List<EnemySystemUI> systems; + + /** + * the hull status ui of the enemy ship + */ + private EnemyHullUI hull; + + /** + * show the ship + */ + @Override + public void showShipView() { + + } + + /** + * hide the ship + */ + @Override + public void hideShipView() { + + } + + /** + * dispose of ship + */ + @Override + public void disposeShipView() { + + } + + /** + * a status of a system was updated and needs to be properly displayed + * eg system hit + * TODO add parameter which system it is OR each controller gets one ui thing, in which case the whole relations here need to be destroyed + * @param damage the damage to the system + */ + public void systemStatusUpdate(int damage) { + + } + + /** + * the hull was hit and the status of it needs to be updated + */ + public void hullHit() { + + } + + /** + * animation of the ship being destroyed + */ + public void shipDestroyedAnimation() { + + } + + /** + * animation of the ship fleeing + */ + public void shipFleeingAnimation() { + + } + + /** + * update of the hull status (hp) + * + * @param hpvalue new status + */ + @Override + public void hullStatusUpdate(int hpvalue) { + + } + + /** + * shield status update + * + * @param shieldvalue new status + */ + @Override + public void shieldStatusUpdate(int shieldvalue) { + + } + + + /** + * Constructor + * TODO methods to access all shipinfo stuff + * @param main - the main class for SpriteBatch + */ + public EnemyShip(Main main, Ship ship) { + super(main, ship); + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Ship/ShipView.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Ship/ShipView.java index 8d3eea1676c682216726f1c6cf8e6e3dc8fd2d51..3558c732a2cf983000bc1c3b799602e8b640ddab 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Ship/ShipView.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Ship/ShipView.java @@ -1,37 +1,67 @@ package com.galaxytrucker.galaxytruckerreloaded.View.UI.Ship; -import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.scenes.scene2d.ui.List; import com.galaxytrucker.galaxytruckerreloaded.Main; import com.galaxytrucker.galaxytruckerreloaded.Model.Ship; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.AutofireButton; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.MoveButton; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.ShipButton; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.ShipInformation.*; -public class ShipView { +public class ShipView extends AbstractShip { /** - * SpriteBatch + * the uis of all the crew members */ - private SpriteBatch batch; + private List<CrewUI> crew; /** - * Orthographic camera + * the energy ui of this ship */ - private OrthographicCamera camera; + private EnergyUI energy; /** - * Ship used by this view + * the hull ui of this ship */ - private Ship ship; + private HullUI hull; /** - * Background image if its the enemy ship + * the ui displaying the amount of money the player has */ - private Texture enemyShipBackgroundTexture; + private ScrapUI money; /** - * Ship shield view + * button to open the inventory (InventoryUI) */ - private ShieldView shieldView; + private ShipButton inventory; + + /** + * button on the upper center + * after the button is clicked, the map opens and a target needs to be selected + */ + private MoveButton moveButton; + + /** + * the weapon autofire button + */ + private AutofireButton weaponAutofire; + + /** + * the background texture of the ship + */ + private Texture shipBackground; + + + /** + * the general background for the weapon display in the bottom left corner next to the energy status display + */ + private Texture weaponGeneralBackground; + + /** + * for display in the upper left corner + */ + private Texture statusTexture; /** * Setup called after initialisation @@ -44,7 +74,7 @@ public class ShipView { */ public void showShipView() { } - + /** * Hide the ship */ @@ -57,6 +87,50 @@ public class ShipView { public void disposeShipView() { } + /** + * update of the hull status (hp) + * + * @param hpvalue new status + */ + @Override + public void hullStatusUpdate(int hpvalue) { + + } + + /** + * shield status update + * + * @param shieldvalue new status + */ + @Override + public void shieldStatusUpdate(int shieldvalue) { + + } + + /** + * open the inventory of this ship + * called by ship button + */ + public void openInventory() { + + } + + /** + * open the map + * called by move button + */ + public void openMap() { + + } + + /** + * autofire + * called by autofire button + */ + public void autofire() { + + } + /** * Ship hop animation */ @@ -71,9 +145,10 @@ public class ShipView { /** * Constructor - * + * TODO methods to access all shipinformation stuff * @param main - the main class for SpriteBatch */ - public ShipView(Main main) { + public ShipView(Main main, Ship ship) { + super(main, ship); } } diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/CrewUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/CrewUI.java new file mode 100644 index 0000000000000000000000000000000000000000..aebfc4021cb58b19ecbd1f74fcfbcf904271d414 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/CrewUI.java @@ -0,0 +1,134 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.ShipInformation; + +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.Crew.Crew; + +import com.badlogic.gdx.scenes.scene2d.ui.List; +import com.galaxytrucker.galaxytruckerreloaded.Model.ShipLayout.Room; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.CrewDismissButton; + +/** + * shows the crew on board + */ +public class CrewUI { + + /** + * Sprite batch + */ + private SpriteBatch batch; + + /** Orthographic camera */ + private OrthographicCamera camera; + + /** image of the crew member for the side bar **/ + private Texture crewImage; + + /** + * the crew texture that is used to display the crew member in the ship + */ + private Texture crewInShip; + + /** + * texture for the status of the crew member + */ + private List<Texture> crewStatus; + + /** + * button to click to send the crew to another room. After the button is clicked, + * the player needs to click on a room in their own ship + */ + private CrewDismissButton crewButton; + + /** + * the name of the crew member + */ + private String name; + + /** + * the current health of the crew member + */ + private int health; + + /** + * the maximum health of the crew member + */ + private int maxhealth; + + /** + * the crew member was moved to a new room + * + * @param room the new room + */ + public void crewMoved(Room room) { + + } + + /** + * the crew was chosen to be moved + * called by button crewdismiss + * not waiting for the user to choose a room on the ship + */ + public void crewMoving() { + + } + + /** + * the crew member died + */ + public void crewDied() { + + } + + /** + * animation showing the crew member is currently repairing something + */ + public void crewRepairAnimation() { + + } + + /** + * Setup called after initialisation + */ + private void setup() { + } + + /** + * show the Crew ui + */ + public void showCrewUI() { + + } + + /** + * hide the Crew ui + */ + public void hideCrewUI() { + + } + + /** + * dispose of the crew UI + */ + public void disposeCrewUI() { + + } + + /** + * the crew member was hit and the status needs to be updated + */ + public void statusUpdate() { + + } + + /** + * constructor + * @param main the main class + * @param crew the crew member + */ + public CrewUI(Main main, Crew crew) { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/EnergyUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/EnergyUI.java new file mode 100644 index 0000000000000000000000000000000000000000..37673fcf2679f2046cb218e98def39faa5497011 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/EnergyUI.java @@ -0,0 +1,79 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.ShipInformation; + +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.badlogic.gdx.scenes.scene2d.ui.List; + +/** + * shows the energy the ship has + */ +public class EnergyUI { + + /** + * Sprite batch + */ + private SpriteBatch batch; + + /** Orthographic camera */ + private OrthographicCamera camera; + + /** + * the textures to display the overall amount of + * energy that was not yet given to any system + */ + private List<Texture> energyTextures; + + /** + * the amount of energy left not allocated to systems + */ + private int energy; + + /** + * the current status of the energy needs to be updated + * @param energyStatus the new status + */ + public void energyUpdate(int energyStatus) { + + } + + + /** + * Setup called after initialisation + */ + private void setup() { + } + + /** + * show the energy ui + */ + public void showEnergyUI() { + + } + + /** + * hide the energy ui + */ + public void hideEnergyUI() { + + } + + /** + * dispose of the EnergyUI + */ + public void disposeEnergyUI() { + + } + + + + /** + * constructor + * @param main the main class + * @param energy the amount of energy unallocated to systems + */ + public EnergyUI(Main main, int energy) { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/HullUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/HullUI.java index 82870ec2b467c6b4757b1e6985b22d12580219b7..8c3362f184880c8e28a5e6819c207a7a4e14583b 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/HullUI.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/HullUI.java @@ -31,6 +31,11 @@ public class HullUI { */ private List<Texture> hullTextures; + /** + * the current status + */ + private int status; + /** * setup called after initialisation */ @@ -55,11 +60,19 @@ public class HullUI { public void disposeHullUI() { } + /** + * the status of the hull was updated, meaning a new texture needs to be displayed + */ + public void updateStatus() { + + } + /** * Constructor * * @param main - main class + * @param status the current status of the hull */ - public HullUI(Main main) { + public HullUI(Main main, int status) { } } diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/RoomUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/RoomUI.java new file mode 100644 index 0000000000000000000000000000000000000000..1dee9703bfd5c78816856ce377bd847d7c9d1056 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/RoomUI.java @@ -0,0 +1,103 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.ShipInformation; + +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.Ship; +import com.galaxytrucker.galaxytruckerreloaded.Model.ShipLayout.Room; + +public class RoomUI { + + /** + * SpriteBatch + */ + private SpriteBatch batch; + + /** + * Orthographic camera + */ + private OrthographicCamera camera; + + /** + * the system of this room + */ + private SubsystemUI system; + + /** + * the normal texture of the room + */ + private Texture roomTexture; + + /** + * the texture for the case that the room is low on oxygen + */ + private Texture roomLowOxyTexture; + + /** + * Höhe des Raumes. Räume sind immer rechteckig. + */ + private int height; + + /** + * Weite des Raumes. Räume sind immer rechteckig. + */ + private int width; + + /** + * animation for the case that the room was hit + */ + public void roomHitAnimation() { + + } + + /** + * the rooms texture changes because it is low on oxygen + * + */ + public void roomLowOnOxygen() { + + } + + /** + * the room was targeted by a weapon of an enemy ship + */ + public void roomTarget() { + + } + + /** + * setup called after initialisation + * + * + */ + private void setup() { + } + + /** + * show the room ui + */ + public void showRoomUI() { + } + + /** + * hide the room ui + */ + public void hideRoomUI() { + } + + /** + * Dispose of room ui + */ + public void disposeRoomUI() { + } + + /** + * Constructor + * + * @param main - the main class for SpriteBatch + * @param room the room + */ + public RoomUI(Main main, Room room) { + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/ScrapUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/ScrapUI.java index 42895a13e23bc7052c2557e7edbf26e7a50d03bf..4455db5116dbfabf269ed1a11bf3c8e2e70ef736 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/ScrapUI.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/ScrapUI.java @@ -22,6 +22,11 @@ public class ScrapUI { */ private Texture scrapBackground; + /** + * the amount of money + */ + private int amount; + /** * setup called after initialisation */ @@ -46,11 +51,20 @@ public class ScrapUI { public void disposeScrapUI() { } + /** + * the amount of money is updated + * @param amount the new amount + */ + public void changeAmount(int amount) { + + } + /** * Constructor * * @param main - main class used for sprite batch and camera + * @param money the amount of money */ - public ScrapUI(Main main) { + public ScrapUI(Main main, int money) { } } diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/ShieldUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/ShieldUI.java index 6f7573daa8c8b484eabf130235b2823df83ceec5..6335bd82e1fc323436cb4ab7b1d1d471ac5d333f 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/ShieldUI.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/ShieldUI.java @@ -5,8 +5,9 @@ import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.scenes.scene2d.ui.List; import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.ShipLayout.Shield; -public class ShieldUI { +public class ShieldUI extends SubsystemUI { /** * Sprite batch @@ -17,9 +18,9 @@ public class ShieldUI { private OrthographicCamera camera; /** - * Shield screen background texture + * the texture for display in the actual gameplay */ - private Texture background; + private Texture onShip; /** * Shield textures @@ -50,11 +51,31 @@ public class ShieldUI { public void disposeShieldUI() { } + /** + * shield was hit + */ + public void shieldHitAnimation() { + + } + + /** + * the status of the system was updated either by damage or by repair + * here + * + * @param damage the current status, with 0 being completely functional + */ + @Override + public void systemStatusUpdate(int damage) { + + } + /** * Constructor * * @param main - the main class + * @param shield the shield */ - public ShieldUI(Main main) { + public ShieldUI(Main main, Shield shield) { + super(main, shield); } } diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/SubsystemUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/SubsystemUI.java new file mode 100644 index 0000000000000000000000000000000000000000..fb9922f94e45b74e6de67be69ae9210547d7dab9 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/SubsystemUI.java @@ -0,0 +1,133 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.ShipInformation; + +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.scenes.scene2d.ui.List; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.ShipLayout.System; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.SystemButton; + +/** + * shows the subsystems of the ship + */ +public class SubsystemUI { + + /** + * Sprite batch + */ + private SpriteBatch batch; + + /** Orthographic camera */ + private OrthographicCamera camera; + + /** + * the textures to display the system in its current damage level + * use for both the room on the ship and the bottom left corner + */ + private List<Texture> systemTexture; + + /** + * the textures for the energy + * bottom left corner + */ + private List<Texture> energyTexture; + + /** + * botton representing the system in the bottom left corner. + * used to give the system energy + */ + private SystemButton energyButton; + + /** + * x position of the room + */ + private float x; + + /** + * y position of the room + */ + private float y; + + /** + * the current energy level + */ + private int energy; + /** + * the maximum energy level + */ + private int maxEnergy; + /** + * the amount of damage to this system + */ + private int damage; + + /** + * Setup called after initialisation + */ + private void setup() { + } + + /** + * show the Subsystem ui + */ + public void showSubsystemUI() { + + } + + /** + * hide the Subsystem ui + */ + public void hideSubsystemUI() { + + } + + /** + * dispose of the Subsystem UI + */ + public void disposeSubsystemUI() { + + } + + /** + * updates the energy of the system (bottom left) + * @param energy the current energy level + */ + public void energyUpdate(int energy) { + + } + + /** + * the status of the system was updated either by damage or by repair + * @param damage the current status, with 0 being completely functional + */ + public void systemStatusUpdate(int damage) { + + } + + /** + * activates the energy supply for this system + * called by systembutton + * if energy supply already activated and not at maximum, then more energy to this system + */ + public void activateEnergy() { + + } + + /** + * the energy supply for this system is lowered, unless there is no supply + * called by systembutton + */ + public void lessEnergy() { + + } + + /** + * constructor + * @param main the main class + * @param system the system + */ + public SubsystemUI(Main main, System system) { + + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/WeaponUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/WeaponUI.java new file mode 100644 index 0000000000000000000000000000000000000000..9a6ba9a254dfd86e716119513866fa7690700641 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/WeaponUI.java @@ -0,0 +1,73 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.ShipInformation; + +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.scenes.scene2d.ui.List; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.Model.Weapons.Weapon; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.WeaponActivateButton; + +/** + * shows the weapons of the ship + */ +//TODO als subklasse zu subsystemui sobald gemergt mit master +public class WeaponUI { + + /** Weapon coolDown */ + private int cooldown; + + /** Weapon energy */ + private int energy; + + /** + * How many projectiles are fired per burst + */ + private int burst; + + /** + * the texure to display the weapon background + */ + private Texture weaponBackground; + + /** + * the textures to display the cooldown until the weapon can be used again + */ + private List<Texture> weaponCooldown; + + /** + * button used to activate/deactive weapon in the bottom left corner + * after weapon is activated, a room in the enemy ship needs to be selected + */ + private WeaponActivateButton activateButton; + + /** + * Setup called after initialisation + */ + private void setup() { + } + + /** + * animation for when the weapon was shot + */ + public void weaponShotAnimation() { + + } + + /** + * the weapon is activated. now, a room needs to be selected + * if weapon is active, it is deactivated + * called by weaponactivatebutton + */ + public void weaponactivated() { + + } + + /** + * constructor + * @param main the main class + * @param weapon the weapon + */ + public WeaponUI(Main main, Weapon weapon) { + } +}