summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2023-11-25 14:24:49 -0800
committerJasper St. Pierre <jstpierre@mecheye.net>2023-11-25 14:24:57 -0800
commit855fb1e2ed4ee5440f2cb30c577b80dd6121d9fd (patch)
treed2749a5d398ad0369bf3de37970b63db6d1195e2 /src
parentfc958a8953cc7b06612508d2bc24587bc1b59736 (diff)
JUTConsole work
Diffstat (limited to 'src')
-rw-r--r--src/JSystem/JUtility/JUTConsole.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/JSystem/JUtility/JUTConsole.cpp b/src/JSystem/JUtility/JUTConsole.cpp
index 618716b3..5548ace7 100644
--- a/src/JSystem/JUtility/JUTConsole.cpp
+++ b/src/JSystem/JUtility/JUTConsole.cpp
@@ -368,13 +368,34 @@ void JUTConsoleManager::appendConsole(JUTConsole* console) {
JUT_ASSERT(0x3bf, sManager != 0 && console != 0);
// need to figure out how TLinkList works
- JGadget::TLinkListNode node = console->mListNode;
- mLinkList.Find(&node);
+ JUT_ASSERT(0x3c2, soLink_.Find( console ) == soLink_.end());
+
+ soLink_.Push_back(console);
+
+ if (mActiveConsole == NULL)
+ mActiveConsole = console;
}
/* 802CB4C4-802CB674 .text removeConsole__17JUTConsoleManagerFP10JUTConsole */
void JUTConsoleManager::removeConsole(JUTConsole* console) {
/* Nonmatching */
+ JUT_ASSERT(0x3d6, sManager != 0 && console != 0);
+ JUT_ASSERT(0x3d9, soLink_.Find( console ) != soLink_.end());
+
+ if (mActiveConsole == console) {
+ if (soLink_.size() <= 1) {
+ mActiveConsole = NULL;
+ } else {
+ mActiveConsole = console != soLink_.back() ? soLink_.Element_toValue(console->getNext()) : soLink_.front();
+ }
+ }
+
+ if (JUTGetWarningConsole() == console)
+ JUTSetWarningConsole(NULL);
+ if (JUTGetReportConsole() == console)
+ JUTSetReportConsole(NULL);
+
+ soLink_.Remove(console);
}
/* 802CB674-802CB740 .text draw__17JUTConsoleManagerCFv */
@@ -382,8 +403,10 @@ void JUTConsoleManager::draw() const {
/* Nonmatching */
// need to figure out how TLinkList works
- for (JGadget::TLinkList<JUTConsole, 4>::const_iterator iter = mLinkList.begin(); iter; ++iter) {
- const JUTConsole * pConsole = (const JUTConsole*) (&iter.node - offsetof(JUTConsole, mListNode));
+ JGadget::TLinkList<JUTConsole, 4>::const_iterator iter = soLink_.begin();
+ JGadget::TLinkList<JUTConsole, 4>::const_iterator end = soLink_.end();
+ for (; iter != end; ++iter) {
+ JUTConsole* pConsole = *iter;
if (pConsole != mActiveConsole)
pConsole->doDraw(JUTConsole::INACTIVE);
}