git repos / blockattack-game

blame: source/code/DialogBox.hpp

normal view · raw

59dcb571 sago007 2016-02-14 15:34 1
/*
7a956470 sago007 2016-02-14 17:09 2
===========================================================================
7a956470 sago007 2016-02-14 17:09 3
blockattack - Block Attack - Rise of the Blocks
7a956470 sago007 2016-02-14 17:09 4
Copyright (C) 2005-2016 Poul Sander
7a956470 sago007 2016-02-14 17:09 5
7a956470 sago007 2016-02-14 17:09 6
This program is free software: you can redistribute it and/or modify
7a956470 sago007 2016-02-14 17:09 7
it under the terms of the GNU General Public License as published by
7a956470 sago007 2016-02-14 17:09 8
the Free Software Foundation, either version 2 of the License, or
7a956470 sago007 2016-02-14 17:09 9
(at your option) any later version.
7a956470 sago007 2016-02-14 17:09 10
7a956470 sago007 2016-02-14 17:09 11
This program is distributed in the hope that it will be useful,
7a956470 sago007 2016-02-14 17:09 12
but WITHOUT ANY WARRANTY; without even the implied warranty of
7a956470 sago007 2016-02-14 17:09 13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7a956470 sago007 2016-02-14 17:09 14
GNU General Public License for more details.
7a956470 sago007 2016-02-14 17:09 15
7a956470 sago007 2016-02-14 17:09 16
You should have received a copy of the GNU General Public License
7a956470 sago007 2016-02-14 17:09 17
along with this program.  If not, see http://www.gnu.org/licenses/
7a956470 sago007 2016-02-14 17:09 18
7a956470 sago007 2016-02-14 17:09 19
Source information and contacts persons can be found at
7a956470 sago007 2016-02-14 17:09 20
http://www.blockattack.net
7a956470 sago007 2016-02-14 17:09 21
===========================================================================
7a956470 sago007 2016-02-14 17:09 22
*/
59dcb571 sago007 2016-02-14 15:34 23
59dcb571 sago007 2016-02-14 15:34 24
#ifndef DIALOGBOX_HPP
59dcb571 sago007 2016-02-14 15:34 25
#define DIALOGBOX_HPP
59dcb571 sago007 2016-02-14 15:34 26
59dcb571 sago007 2016-02-14 15:34 27
#include "sago/GameStateInterface.hpp"
59dcb571 sago007 2016-02-14 15:34 28
#include <string>
59dcb571 sago007 2016-02-14 15:34 29
#include "ReadKeyboard.h"
59dcb571 sago007 2016-02-14 15:34 30
#include <memory>
59dcb571 sago007 2016-02-14 15:34 31
#include "scopeHelpers.hpp"
0c201300 sago007 2016-02-20 12:12 32
#include "global.hpp"
59dcb571 sago007 2016-02-14 15:34 33
59dcb571 sago007 2016-02-14 15:34 34
class DialogBox : public sago::GameStateInterface {
59dcb571 sago007 2016-02-14 15:34 35
public:
96e759d9 sago007 2016-04-17 18:45 36
	DialogBox(int x, int y, const std::string& name, const std::string& header);
59dcb571 sago007 2016-02-14 15:34 37
	DialogBox(const DialogBox& orig) = delete;
59dcb571 sago007 2016-02-14 15:34 38
	virtual ~DialogBox();
59dcb571 sago007 2016-02-14 15:34 39
	
59dcb571 sago007 2016-02-14 15:34 40
	bool IsActive() override;
59dcb571 sago007 2016-02-14 15:34 41
	void Draw(SDL_Renderer* target) override;
59dcb571 sago007 2016-02-14 15:34 42
	void ProcessInput(const SDL_Event& event, bool &processed) override;
47fef8e8 sago007 2016-11-24 21:37 43
	void SetName(const std::string& name);
47fef8e8 sago007 2016-11-24 21:37 44
	std::string GetName() const;
47fef8e8 sago007 2016-11-24 21:37 45
	bool IsUpdated() const;
59dcb571 sago007 2016-02-14 15:34 46
private:
59dcb571 sago007 2016-02-14 15:34 47
	bool isActive = true;
59dcb571 sago007 2016-02-14 15:34 48
	std::shared_ptr<ReadKeyboard> rk;
59dcb571 sago007 2016-02-14 15:34 49
	int x; 
59dcb571 sago007 2016-02-14 15:34 50
	int y;
59dcb571 sago007 2016-02-14 15:34 51
	std::string name;
96e759d9 sago007 2016-04-17 18:45 52
	std::string header;
59dcb571 sago007 2016-02-14 15:34 53
	bool updated = false;
59dcb571 sago007 2016-02-14 15:34 54
	SDL_TextInput textInputScope;
34f6ec6d sago007 2018-03-29 16:17 55
	sago::SagoTextField headerLabel;
34f6ec6d sago007 2018-03-29 16:17 56
	sago::SagoTextField enterLabel;
34f6ec6d sago007 2018-03-29 16:17 57
	sago::SagoTextField cancelLabel;
59dcb571 sago007 2016-02-14 15:34 58
};
59dcb571 sago007 2016-02-14 15:34 59
59dcb571 sago007 2016-02-14 15:34 60
#endif /* DIALOGBOX_HPP */
59dcb571 sago007 2016-02-14 15:34 61
1970-01-01 00:00 62