mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 12:44:02 +00:00
GUI: Add possibility to specify Debugger prompt
This commit is contained in:
parent
007d94963b
commit
b97b2b0fe3
@ -121,6 +121,16 @@ void ConsoleDialog::init() {
|
||||
_pageWidth = (_w - scrollBarWidth - 2 - _leftPadding - _topPadding - scrollBarWidth) / kConsoleCharWidth;
|
||||
_linesPerPage = (_h - 2 - _topPadding - _bottomPadding) / kConsoleLineHeight;
|
||||
_linesInBuffer = kBufferSize / kCharsPerLine;
|
||||
|
||||
resetPrompt();
|
||||
}
|
||||
|
||||
void ConsoleDialog::setPrompt(Common::String prompt) {
|
||||
_prompt = prompt;
|
||||
}
|
||||
|
||||
void ConsoleDialog::resetPrompt() {
|
||||
_prompt = PROMPT;
|
||||
}
|
||||
|
||||
void ConsoleDialog::slideUpAndClose() {
|
||||
@ -159,7 +169,7 @@ void ConsoleDialog::open() {
|
||||
if ((_promptStartPos == -1) || (_currentPos > _promptEndPos)) {
|
||||
// we print a prompt, if this is the first time we are called or if the
|
||||
// engine wrote onto us since the last call
|
||||
print(PROMPT);
|
||||
print(_prompt.c_str());
|
||||
_promptStartPos = _promptEndPos = _currentPos;
|
||||
}
|
||||
|
||||
@ -283,7 +293,7 @@ void ConsoleDialog::handleKeyDown(Common::KeyState state) {
|
||||
keepRunning = (*_callbackProc)(this, userInput.c_str(), _callbackRefCon);
|
||||
}
|
||||
|
||||
print(PROMPT);
|
||||
print(_prompt.c_str());
|
||||
_promptStartPos = _promptEndPos = _currentPos;
|
||||
|
||||
g_gui.scheduleTopDialogRedraw();
|
||||
|
@ -129,6 +129,8 @@ protected:
|
||||
|
||||
void slideUpAndClose();
|
||||
|
||||
Common::String _prompt;
|
||||
|
||||
public:
|
||||
ConsoleDialog(float widthPercent, float heightPercent);
|
||||
virtual ~ConsoleDialog();
|
||||
@ -161,6 +163,9 @@ public:
|
||||
return _pageWidth;
|
||||
}
|
||||
|
||||
void setPrompt(Common::String prompt);
|
||||
void resetPrompt();
|
||||
|
||||
protected:
|
||||
inline char &buffer(int idx) {
|
||||
return _buffer[idx % kBufferSize];
|
||||
|
@ -92,6 +92,18 @@ void Debugger::clearVars() {
|
||||
}
|
||||
|
||||
|
||||
void Debugger::setPrompt(Common::String prompt) {
|
||||
#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER
|
||||
_debuggerDialog->setPrompt(prompt);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Debugger::resetPrompt() {
|
||||
#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER
|
||||
_debuggerDialog->resetPrompt();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Initialisation Functions
|
||||
int Debugger::getCharsPerLine() {
|
||||
#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER
|
||||
|
@ -168,6 +168,9 @@ protected:
|
||||
*/
|
||||
void clearVars();
|
||||
|
||||
void setPrompt(Common::String prompt);
|
||||
void resetPrompt();
|
||||
|
||||
private:
|
||||
/**
|
||||
* The frame countdown specifies a number of frames that must pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user