From: Ondrej H. <tan...@us...> - 2004-04-07 15:35:26
|
Update of /cvsroot/planeshift/planeshift/src/client/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21577/src/client/gui Modified Files: pawscreditswindow.cpp pawscreditswindow.h Log Message: - A few minor Credits window fixes. Index: pawscreditswindow.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/gui/pawscreditswindow.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pawscreditswindow.cpp 5 Apr 2004 18:30:29 -0000 1.1 --- pawscreditswindow.cpp 7 Apr 2004 15:22:26 -0000 1.2 *************** *** 55,58 **** --- 55,65 ---- //------------------------------------------------------------------- + void pawsCreditsWindow::Show() + { + pawsWidget::Show(); + pixelAt = 0; + startPos = -numLines + 1; + } + bool pawsCreditsWindow::PostSetup() { *************** *** 111,118 **** { //Yes! ! width = node->GetAttributeValueAsInt("width"); ! height = node->GetAttributeValueAsInt("height"); ! x = node->GetAttributeValueAsInt("x"); ! y = node->GetAttributeValueAsInt("y"); speed = node->GetAttributeValueAsInt("speed"); loop = node->GetAttributeValueAsBool("loop"); --- 118,125 ---- { //Yes! ! width = GetActualWidth(node->GetAttributeValueAsInt("width")); ! height = GetActualHeight(node->GetAttributeValueAsInt("height")); ! x = GetActualWidth(node->GetAttributeValueAsInt("x")); ! y = GetActualHeight(node->GetAttributeValueAsInt("y")); speed = node->GetAttributeValueAsInt("speed"); loop = node->GetAttributeValueAsBool("loop"); *************** *** 168,176 **** size_t len = strcspn (dat+cur, "\n"); unsigned int maxlen; - bool shorted = false; maxlen = font->GetLength(dat+cur, width ); ! ! // only break line after words if (maxlen < len) --- 175,181 ---- size_t len = strcspn (dat+cur, "\n"); unsigned int maxlen; maxlen = font->GetLength(dat+cur, width ); ! // only break line after words if (maxlen < len) *************** *** 187,192 **** } } - shorted = true; - } --- 192,195 ---- *************** *** 197,207 **** csString newstr = dat+cur; - //Did we short the string? - if(!shorted) - { - newstr = dat+cur; - newstr = newstr.Slice(0,newstr.Length()-1); - } - credits.Push(newstr); cur += len+1; --- 200,203 ---- *************** *** 326,329 **** --- 322,333 ---- } + int black = g2d->FindRGB(0, 0, 0); + + g2d->Write(font, + x+2, + textYofs+i*textHeight-pixelAt+2, + black, -1, + line.GetData() ); + c = g2d->FindRGB(cR, cG, cB); Index: pawscreditswindow.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/gui/pawscreditswindow.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pawscreditswindow.h 5 Apr 2004 18:35:20 -0000 1.2 --- pawscreditswindow.h 7 Apr 2004 15:22:26 -0000 1.3 *************** *** 36,39 **** --- 36,40 ---- void Draw(); void Hide(); + void Show(); bool OnButtonPressed(int button, int keyModifier, pawsWidget *widget); |