EchoesOfFate
A game for our COMP315 Project
 
Loading...
Searching...
No Matches
InventoryState.h
Go to the documentation of this file.
1#pragma once
2#include "State.h"
3#include <vector>
4#include "Player.h"
5#include "Inventory.h"
6class PauseMenuState;
7
9private:
10 bool soundOn;
11 float volume;
12 sf::Font font;
13 sf::Text soundButton;
14 sf::Text backButton;
15 std::vector<sf::Sprite> imgs;
16 sf::Music* m;
17 float slotSize;
18 int first;
19 bool second = false;
20 Inventory inv;
21 const static int MAX_VERT = 100;
22 int begin = 0;
23 Player* ply;
24 std::vector<sf::Texture>* textures;
25 std::vector<sf::Sprite>* sprites;
26 std::vector<std::string>* filepaths;
27
28
29public:
31 void setupButton(sf::Text& button, const std::string& label, float x, float y);
32 void setupInventory(sf::Sprite& img, const sf::Texture& texture, float x, float y, float size);
33 void setPlayerInventory(Player* ply, std::vector<sf::Texture>* textures, std::vector<sf::Sprite>* sprites, std::vector<std::string>* filepaths);
34 void handleClick(sf::RenderWindow& window);
35 void draw(sf::RenderWindow& window);
36 void toggleSound();
37 bool isSoundOn() const;
38 void setMusicReference(sf::Music& music);
39 void setMenuReference(PauseMenuState* menuPtr);
41
42};
Definition Inventory.h:9
PauseMenuState * menu
New function to set menu reference.
Definition InventoryState.h:40
void setPlayerInventory(Player *ply, std::vector< sf::Texture > *textures, std::vector< sf::Sprite > *sprites, std::vector< std::string > *filepaths)
Definition InventoryState.cpp:24
void draw(sf::RenderWindow &window)
Definition InventoryState.cpp:127
void setMenuReference(PauseMenuState *menuPtr)
Definition InventoryState.cpp:166
bool isSoundOn() const
Definition InventoryState.cpp:160
void handleClick(sf::RenderWindow &window)
handles the clicks
Definition InventoryState.cpp:77
void toggleSound()
Definition InventoryState.cpp:140
void setupInventory(sf::Sprite &img, const sf::Texture &texture, float x, float y, float size)
sets the texture and position of a sprite, and scales it
Definition InventoryState.cpp:58
InventoryState()
Please note this is a Very old version of the options Needs to work with the new audio manager class.
Definition InventoryState.cpp:11
void setMusicReference(sf::Music &music)
Definition InventoryState.cpp:163
void setupButton(sf::Text &button, const std::string &label, float x, float y)
sets up the buttons
Definition InventoryState.cpp:69
Definition PauseMenuState.h:8
Definition Player.h:17