git repos / blockattack-game

blame: source/code/ModConfigMenuState.hpp

normal view · raw

3affd2d6 Poul Sander 2020-12-27 15:56 1
/*
3affd2d6 Poul Sander 2020-12-27 15:56 2
===========================================================================
3affd2d6 Poul Sander 2020-12-27 15:56 3
blockattack - Block Attack - Rise of the Blocks
3affd2d6 Poul Sander 2020-12-27 15:56 4
Copyright (C) 2005-2020 Poul Sander
3affd2d6 Poul Sander 2020-12-27 15:56 5
3affd2d6 Poul Sander 2020-12-27 15:56 6
This program is free software: you can redistribute it and/or modify
3affd2d6 Poul Sander 2020-12-27 15:56 7
it under the terms of the GNU General Public License as published by
3affd2d6 Poul Sander 2020-12-27 15:56 8
the Free Software Foundation, either version 2 of the License, or
3affd2d6 Poul Sander 2020-12-27 15:56 9
(at your option) any later version.
3affd2d6 Poul Sander 2020-12-27 15:56 10
3affd2d6 Poul Sander 2020-12-27 15:56 11
This program is distributed in the hope that it will be useful,
3affd2d6 Poul Sander 2020-12-27 15:56 12
but WITHOUT ANY WARRANTY; without even the implied warranty of
3affd2d6 Poul Sander 2020-12-27 15:56 13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3affd2d6 Poul Sander 2020-12-27 15:56 14
GNU General Public License for more details.
3affd2d6 Poul Sander 2020-12-27 15:56 15
3affd2d6 Poul Sander 2020-12-27 15:56 16
You should have received a copy of the GNU General Public License
3affd2d6 Poul Sander 2020-12-27 15:56 17
along with this program.  If not, see http://www.gnu.org/licenses/
3affd2d6 Poul Sander 2020-12-27 15:56 18
3affd2d6 Poul Sander 2020-12-27 15:56 19
Source information and contacts persons can be found at
3affd2d6 Poul Sander 2020-12-27 15:56 20
https://blockattack.net
3affd2d6 Poul Sander 2020-12-27 15:56 21
===========================================================================
3affd2d6 Poul Sander 2020-12-27 15:56 22
*/
3affd2d6 Poul Sander 2020-12-27 15:56 23
3affd2d6 Poul Sander 2020-12-27 15:56 24
#ifndef MODCONFIG_HPP
3affd2d6 Poul Sander 2020-12-27 15:56 25
#define MODCONFIG_HPP
3affd2d6 Poul Sander 2020-12-27 15:56 26
3affd2d6 Poul Sander 2020-12-27 15:56 27
#include "sago/GameStateInterface.hpp"
3affd2d6 Poul Sander 2020-12-27 15:56 28
#include "sago/SagoTextField.hpp"
3affd2d6 Poul Sander 2020-12-27 15:56 29
#include "sago/SagoTextBox.hpp"
3affd2d6 Poul Sander 2020-12-27 15:56 30
#include "global.hpp"
3affd2d6 Poul Sander 2020-12-27 15:56 31
#include "common.h"
3affd2d6 Poul Sander 2020-12-27 15:56 32
3affd2d6 Poul Sander 2020-12-27 15:56 33
struct Mod {
3affd2d6 Poul Sander 2020-12-27 15:56 34
	std::string name;
3affd2d6 Poul Sander 2020-12-27 15:56 35
	std::string filename;
3affd2d6 Poul Sander 2020-12-27 15:56 36
	bool enabled = false;
3affd2d6 Poul Sander 2020-12-27 15:56 37
	int order = 0;
3affd2d6 Poul Sander 2020-12-27 15:56 38
};
3affd2d6 Poul Sander 2020-12-27 15:56 39
3affd2d6 Poul Sander 2020-12-27 15:56 40
/**
3affd2d6 Poul Sander 2020-12-27 15:56 41
 * This will one day be the menu to configure mods.
3affd2d6 Poul Sander 2020-12-27 15:56 42
 * This will need to be able to scan the filesystem for mods
3affd2d6 Poul Sander 2020-12-27 15:56 43
 */
3affd2d6 Poul Sander 2020-12-27 15:56 44
class ModConfigMenuState : public sago::GameStateInterface {
3affd2d6 Poul Sander 2020-12-27 15:56 45
public:
3affd2d6 Poul Sander 2020-12-27 15:56 46
	ModConfigMenuState();
3affd2d6 Poul Sander 2020-12-27 15:56 47
	ModConfigMenuState(const ModConfigMenuState& orig) = delete;
3affd2d6 Poul Sander 2020-12-27 15:56 48
	virtual ~ModConfigMenuState();
3affd2d6 Poul Sander 2020-12-27 15:56 49
3affd2d6 Poul Sander 2020-12-27 15:56 50
	bool IsActive() override;
3affd2d6 Poul Sander 2020-12-27 15:56 51
	void Draw(SDL_Renderer* target) override;
3affd2d6 Poul Sander 2020-12-27 15:56 52
	void ProcessInput(const SDL_Event& event, bool &processed) override;
3affd2d6 Poul Sander 2020-12-27 15:56 53
	void Update() override;
3affd2d6 Poul Sander 2020-12-27 15:56 54
3affd2d6 Poul Sander 2020-12-27 15:56 55
private:
3affd2d6 Poul Sander 2020-12-27 15:56 56
	bool isActive = true;
3affd2d6 Poul Sander 2020-12-27 15:56 57
	bool bMouseUp = true;
3affd2d6 Poul Sander 2020-12-27 15:56 58
	std::vector<Mod> mods_available;
3affd2d6 Poul Sander 2020-12-27 15:56 59
};
3affd2d6 Poul Sander 2020-12-27 15:56 60
3affd2d6 Poul Sander 2020-12-27 15:56 61
#endif /* MODCONFIG_HPP */
1970-01-01 00:00 62