- Timestamp:
- Sep 25, 2005, 1:31:18 AM (19 years ago)
- Location:
- trunk/src/lib/shell
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell.cc
r5251 r5253 42 42 ->setAlias("hide"); 43 43 SHELL_COMMAND(textsize, Shell, setTextSize) 44 ->describe("Sets the size of the Text (size, linespacing)"); 44 ->describe("Sets the size of the Text (size, linespacing)") 45 ->defaultValues(15, 0); 45 46 46 47 /** … … 64 65 this->lineSpacing = 0; 65 66 this->bActive = false; 66 this->fontFile = NULL;67 this->setFont("fonts/dpquake_.ttf");67 this->fontFile = new char[strlen(SHELL_DEFAULT_FONT)+1]; 68 strcpy(this->fontFile, SHELL_DEFAULT_FONT); 68 69 69 70 // BUFFER … … 125 126 void Shell::deactivate() 126 127 { 127 this->setFont("fonts/dark_crystal.ttf");128 this->rebuildText();129 130 128 if (this->bActive == false) 131 129 PRINTF(3)("The shell is already inactive\n"); … … 133 131 134 132 EventHandler::getInstance()->setState(ES_GAME); 135 this->setRelCoorSoft2D(0, - 400, 1, 5);133 this->setRelCoorSoft2D(0, -(int)this->shellHeight, 1, 5); 136 134 137 135 tIterator<char>* bufferIT = ShellBuffer::getInstance()->getBuffer()->getIterator(); … … 159 157 strcpy(this->fontFile, fontFile); 160 158 159 this->rebuildText(); 161 160 } 162 161 … … 175 174 this->shellInput->setFont(this->fontFile, this->textSize); 176 175 177 //this->rebuildText();176 this->rebuildText(); 178 177 } 179 178 … … 188 187 this->shellInput->setColor(1, 0, 0); 189 188 this->shellInput->setAlignment(TEXT_ALIGN_LEFT); 190 this->shellInput->setParent2D(this); 189 if (shellInput->getParent() != this) 190 this->shellInput->setParent2D(this); 191 191 this->shellInput->setRelCoor2D(5, (this->textSize + this->lineSpacing)*this->bufferDisplaySize + this->textSize); 192 192 … … 209 209 } 210 210 211 tIterator<char>* it = ShellBuffer::getInstance()->getBuffer()->getIterator(); 212 char* text = it->lastElement(); 211 213 bufferText = new Text*[bufferDisplaySize]; 212 214 for (unsigned int i = 0; i < bufferDisplaySize; i++) … … 216 218 bufferText[i]->setAlignment(TEXT_ALIGN_LEFT); 217 219 bufferText[i]->setRelCoor2D(calculateLinePosition(i)); 218 bufferText[i]->setText( NULL);220 bufferText[i]->setText(text); 219 221 bufferText[i]->setParent2D(this); 220 } 222 text = it->prevElement(); 223 } 224 delete it; 221 225 this->bufferDisplaySize = bufferDisplaySize; 222 226 -
trunk/src/lib/shell/shell.h
r5251 r5253 13 13 14 14 #include <stdarg.h> 15 16 #define SHELL_DEFAULT_FONT "fonts/dpquake_.ttf" 15 17 16 18 // FORWARD DECLARATION
Note: See TracChangeset
for help on using the changeset viewer.