From: <wha...@us...> - 2012-01-24 11:44:19
|
Revision: 8036 http://planeshift.svn.sourceforge.net/planeshift/?rev=8036&view=rev Author: whacko88 Date: 2012-01-24 11:44:10 +0000 (Tue, 24 Jan 2012) Log Message: ----------- fixed compilation Modified Paths: -------------- trunk/src/client/gui/pawsbookreadingwindow.cpp Modified: trunk/src/client/gui/pawsbookreadingwindow.cpp =================================================================== --- trunk/src/client/gui/pawsbookreadingwindow.cpp 2012-01-23 16:34:07 UTC (rev 8035) +++ trunk/src/client/gui/pawsbookreadingwindow.cpp 2012-01-24 11:44:10 UTC (rev 8036) @@ -74,7 +74,7 @@ { Show(); psReadBookTextMessage mesg( me ); - csRef<iDocumentNode> docnode = ParseString(mesg.text,"Contents"); + csRef<iDocumentNode> docnode = ParseStringGetNode(mesg.text, "Contents"); if(docnode) dynamic_cast<pawsDocumentView*>(description)->SetText(mesg.text.GetData()); else description->SetText(mesg.text); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2012-01-24 15:05:34
|
Revision: 8037 http://planeshift.svn.sourceforge.net/planeshift/?rev=8037&view=rev Author: weltall2 Date: 2012-01-24 15:05:24 +0000 (Tue, 24 Jan 2012) Log Message: ----------- missing part of the patch from gruby for PS#5449 - psclient writes books to console Modified Paths: -------------- trunk/src/client/gui/pawsbookreadingwindow.cpp Modified: trunk/src/client/gui/pawsbookreadingwindow.cpp =================================================================== --- trunk/src/client/gui/pawsbookreadingwindow.cpp 2012-01-24 11:44:10 UTC (rev 8036) +++ trunk/src/client/gui/pawsbookreadingwindow.cpp 2012-01-24 15:05:24 UTC (rev 8037) @@ -74,7 +74,7 @@ { Show(); psReadBookTextMessage mesg( me ); - csRef<iDocumentNode> docnode = ParseStringGetNode(mesg.text, "Contents"); + csRef<iDocumentNode> docnode = ParseStringGetNode(mesg.text, "Contents", false); if(docnode) dynamic_cast<pawsDocumentView*>(description)->SetText(mesg.text.GetData()); else description->SetText(mesg.text); @@ -144,25 +144,25 @@ csRef<iVFS> vfs = psengine->GetVFS(); csString tempFileNameTemplate = "/planeshift/userdata/books/%s.txt", tempFileName; csString bookFormat; - if (filenameSafe(name->GetText()).Length()) { - tempFileName.Format(tempFileNameTemplate, filenameSafe(name->GetText()).GetData()); - } - else { //The title is made up of Only special chars :-( - tempFileNameTemplate = "/planeshift/userdata/books/book%d.txt"; - unsigned int tempNumber = 0; - do - { - tempFileName.Format(tempFileNameTemplate, tempNumber); - tempNumber++; - } while (vfs->Exists(tempFileName)); - } + if (filenameSafe(name->GetText()).Length()) { + tempFileName.Format(tempFileNameTemplate, filenameSafe(name->GetText()).GetData()); + } + else { //The title is made up of Only special chars :-( + tempFileNameTemplate = "/planeshift/userdata/books/book%d.txt"; + unsigned int tempNumber = 0; + do + { + tempFileName.Format(tempFileNameTemplate, tempNumber); + tempNumber++; + } while (vfs->Exists(tempFileName)); + } bookFormat = description->GetText(); #ifdef _WIN32 - bookFormat.ReplaceAll("\n", "\r\n"); + bookFormat.ReplaceAll("\n", "\r\n"); #endif vfs->WriteFile(tempFileName, bookFormat, bookFormat.Length()); - + psSystemMessage msg(0, MSG_ACK, "Book saved to %s", tempFileName.GetData()+27 ); msg.FireEvent(); return true; @@ -176,11 +176,11 @@ bool pawsBookReadingWindow::isBadChar(char c) { - csString badChars = "/\\?%*:|\"<>"; - if (badChars.FindFirst(c) == (size_t) -1) - return false; - else - return true; + csString badChars = "/\\?%*:|\"<>"; + if (badChars.FindFirst(c) == (size_t) -1) + return false; + else + return true; } void pawsBookReadingWindow::Draw() @@ -196,12 +196,12 @@ csString pawsBookReadingWindow::filenameSafe(const csString &original) { - csString safe; - size_t len = original.Length(); - for (size_t c = 0; c < len; ++c) { - if (!isBadChar(original[c])) - safe += original[c]; - } - return safe; + csString safe; + size_t len = original.Length(); + for (size_t c = 0; c < len; ++c) { + if (!isBadChar(original[c])) + safe += original[c]; + } + return safe; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lpa...@us...> - 2012-12-31 01:41:41
|
Revision: 8525 http://planeshift.svn.sourceforge.net/planeshift/?rev=8525&view=rev Author: lpancallo Date: 2012-12-31 01:41:35 +0000 (Mon, 31 Dec 2012) Log Message: ----------- Fix for turn page bug in readwindow by daveiiv. Modified Paths: -------------- trunk/src/client/gui/pawsbookreadingwindow.cpp Modified: trunk/src/client/gui/pawsbookreadingwindow.cpp =================================================================== --- trunk/src/client/gui/pawsbookreadingwindow.cpp 2012-12-30 22:36:51 UTC (rev 8524) +++ trunk/src/client/gui/pawsbookreadingwindow.cpp 2012-12-31 01:41:35 UTC (rev 8525) @@ -93,11 +93,9 @@ csRef<iDocumentNode> docnode = ParseStringGetNode(mesg.text, "Contents", false); if(docnode) { - // I am not sure why these use dynamic_cast while the craft windows - // do not + // these are casted into the docnode object dynamic_cast<pawsMultiPageDocumentView*>(description)->SetText(mesg.text.GetData()); dynamic_cast<pawsMultiPageDocumentView*>(descriptionRight)->SetText(mesg.text.GetData()); - } else { @@ -143,6 +141,7 @@ // set the descriptionRight to be 1 page ahead of description descriptionRight->SetCurrentPageNum(description->GetCurrentPageNum()+1) ; + description->Show(); descriptionRight->Show(); //set the background image for the book @@ -169,15 +168,19 @@ { descriptionRight->Hide(); } + psMsgCraftingInfo mesg(me); csString text(mesg.craftInfo); - if(text && descriptionCraft) + + if(text && descriptionCraft && descriptionCraftRight) { // setup the craft windows for multi page view - numPages = descriptionCraft->GetNumPages(); + descriptionCraft->SetText(text.GetData()); descriptionCraftRight->SetText(text.GetData()); + numPages = descriptionCraft->GetNumPages(); + // set the descriptionCraftRight to be one page ahead descriptionCraftRight->SetCurrentPageNum(descriptionCraft->GetCurrentPageNum()+1) ; @@ -249,10 +252,13 @@ } else { - if(descriptionCraft->GetCurrentPageNum() <= numPages-2) + if(descriptionCraft && descriptionCraftRight) { - descriptionCraft->SetCurrentPageNum(descriptionCraft->GetCurrentPageNum() + 2); - descriptionCraftRight->SetCurrentPageNum(descriptionCraftRight->GetCurrentPageNum() + 2); + if(descriptionCraft->GetCurrentPageNum() <= numPages-2) + { + descriptionCraft->SetCurrentPageNum(descriptionCraft->GetCurrentPageNum() + 2); + descriptionCraftRight->SetCurrentPageNum(descriptionCraftRight->GetCurrentPageNum() + 2); + } } } return true; @@ -271,10 +277,13 @@ } else { - if(descriptionCraft->GetCurrentPageNum() >= 2) + if(descriptionCraft && descriptionCraftRight) { - descriptionCraft->SetCurrentPageNum(descriptionCraft->GetCurrentPageNum()- 2); - descriptionCraftRight->SetCurrentPageNum(descriptionCraftRight->GetCurrentPageNum()-2); + if(descriptionCraft->GetCurrentPageNum() >= 2) + { + descriptionCraft->SetCurrentPageNum(descriptionCraft->GetCurrentPageNum()- 2); + descriptionCraftRight->SetCurrentPageNum(descriptionCraftRight->GetCurrentPageNum()-2); + } } } return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lpa...@us...> - 2013-03-02 13:58:39
|
Revision: 8626 http://planeshift.svn.sourceforge.net/planeshift/?rev=8626&view=rev Author: lpancallo Date: 2013-03-02 13:58:32 +0000 (Sat, 02 Mar 2013) Log Message: ----------- Fixed a bug where you look at a regular book first the title would still be shown in the Craft book overlayed by text. Modified Paths: -------------- trunk/src/client/gui/pawsbookreadingwindow.cpp Modified: trunk/src/client/gui/pawsbookreadingwindow.cpp =================================================================== --- trunk/src/client/gui/pawsbookreadingwindow.cpp 2013-03-01 19:01:16 UTC (rev 8625) +++ trunk/src/client/gui/pawsbookreadingwindow.cpp 2013-03-02 13:58:32 UTC (rev 8626) @@ -193,10 +193,10 @@ usingCraft = true; } //name->SetText("You discover you can do the following:"); + name->SetText(""); break; } - } -} + }} bool pawsBookReadingWindow::OnButtonPressed(int /*mouseButton*/, int /*keyModifier*/, pawsWidget* widget) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |