ScummVM API documentation
log_input.h
1
/* ScummVM - Graphic Adventure Engine
2
*
3
* ScummVM is the legal property of its developers, whose names
4
* are too numerous to list here. Please refer to the COPYRIGHT
5
* file distributed with this source distribution.
6
*
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*
20
*/
21
22
#ifndef ULTIMA3_VIEWS_INTERACTIONS_LOG_INPUT_H
23
#define ULTIMA3_VIEWS_INTERACTIONS_LOG_INPUT_H
24
25
#include "ultima/ultima3/views/interactions/interaction.h"
26
#include "ultima/ultima3/views/menu_input.h"
27
28
namespace
Ultima {
29
namespace
Ultima3 {
30
namespace
Views {
31
namespace
Interactions {
32
37
class
LogMenu
{
38
private
:
39
MenuChoice
_menu;
40
Common::String
_echo;
41
42
public
:
47
void
setup
(
const
char
*keys,
const
char
*
const
*words,
int
count);
48
52
bool
handleKey
(
const
KeypressMessage
&msg);
53
57
char
key
()
const
{
58
return
_menu.
key
();
59
}
60
};
61
65
class
LogYesNo
{
66
private
:
67
LogMenu
_menu;
68
69
public
:
70
LogYesNo
();
71
75
bool
handleKey
(
const
KeypressMessage
&msg) {
76
return
_menu.
handleKey
(msg);
77
}
78
79
bool
yes()
const
{
80
return
_menu.
key
() ==
'Y'
;
81
}
82
};
83
87
class
LogText
{
88
private
:
89
uint _maxChars = 0;
90
Common::String
_text;
91
92
public
:
93
void
setup(uint maxChars);
94
98
bool
handleKey
(
const
KeypressMessage
&msg);
99
103
Common::String
word
()
const
;
104
};
105
110
class
LogNumber
{
111
private
:
112
int
_maxDigits = 0;
113
bool
_rejectLetters =
false
;
114
Common::String
_text;
115
116
// What was entered, read one digit at a time as BCD
117
int
_bcd = 0;
118
bool
_hasLetters =
false
;
119
124
bool
evaluate();
125
126
public
:
132
void
setup
(
int
maxDigits,
bool
rejectLetters =
false
);
133
138
bool
handleKey
(
const
KeypressMessage
&msg);
139
143
int
bcd
()
const
{
144
return
_bcd;
145
}
146
150
int
value
()
const
{
151
return
Data::fromBcdWord(_bcd);
152
}
153
158
bool
hasLetters
()
const
{
159
return
_hasLetters;
160
}
161
};
162
163
}
// namespace Interactions
164
}
// namespace Views
165
}
// namespace Ultima3
166
}
// namespace Ultima
167
168
#endif
Common::String
Definition:
str.h:59
Ultima::Ultima3::Views::Interactions::LogMenu
Definition:
log_input.h:37
Ultima::Ultima3::Views::Interactions::LogMenu::setup
void setup(const char *keys, const char *const *words, int count)
Ultima::Ultima3::Views::Interactions::LogMenu::key
char key() const
Definition:
log_input.h:57
Ultima::Ultima3::Views::Interactions::LogMenu::handleKey
bool handleKey(const KeypressMessage &msg)
Ultima::Ultima3::Views::Interactions::LogNumber
Definition:
log_input.h:110
Ultima::Ultima3::Views::Interactions::LogNumber::handleKey
bool handleKey(const KeypressMessage &msg)
Ultima::Ultima3::Views::Interactions::LogNumber::bcd
int bcd() const
Definition:
log_input.h:143
Ultima::Ultima3::Views::Interactions::LogNumber::setup
void setup(int maxDigits, bool rejectLetters=false)
Ultima::Ultima3::Views::Interactions::LogNumber::hasLetters
bool hasLetters() const
Definition:
log_input.h:158
Ultima::Ultima3::Views::Interactions::LogNumber::value
int value() const
Definition:
log_input.h:150
Ultima::Ultima3::Views::Interactions::LogText
Definition:
log_input.h:87
Ultima::Ultima3::Views::Interactions::LogText::handleKey
bool handleKey(const KeypressMessage &msg)
Ultima::Ultima3::Views::Interactions::LogText::word
Common::String word() const
Ultima::Ultima3::Views::Interactions::LogYesNo
Definition:
log_input.h:65
Ultima::Ultima3::Views::Interactions::LogYesNo::handleKey
bool handleKey(const KeypressMessage &msg)
Definition:
log_input.h:75
Ultima::Ultima3::Views::MenuChoice
Definition:
menu_input.h:53
Ultima::Ultima3::Views::MenuChoice::key
char key() const
Definition:
menu_input.h:96
Graphics::Views::KeypressMessage
Definition:
messages.h:54
engines
ultima
ultima3
views
interactions
log_input.h
Generated on Sun Nov 22 2026 09:34:26 for ScummVM API documentation by
1.9.4