From f4177a77ceff0e1cffb7e968f3d48497fcd2d45c Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Fri, 24 Jun 2016 10:56:35 -0400 Subject: dialog wrap fix, removed junk files --- Goals.txt | 121 ---------------------------- assets/player/maybeplayer.png | Bin 4146 -> 0 bytes assets/player/player.png | Bin 543 -> 0 bytes assets/player/player1.png | Bin 552 -> 0 bytes assets/player/player2.png | Bin 557 -> 0 bytes assets/style/classic/bg/bagels.jpg | Bin 259847 -> 0 bytes assets/style/classic/bg/bagels.png | Bin 1252347 -> 0 bytes assets/style/classic/bg/bgb.png | Bin 2899454 -> 0 bytes assets/style/classic/bg/bgfarMountains.png | Bin 30875 -> 0 bytes assets/style/classic/bg/forestTileFront.png | Bin 32565 -> 5703 bytes assets/style/rustic/bg/bgfarMountains.png | Bin 30875 -> 0 bytes brice.dat | 4 +- src/entities.cpp | 2 - src/ui.cpp | 27 +++---- storyXML/0000_SpawnHill.xml | 12 --- xcf/bgTrashWaves.xcf | Bin 3932867 -> 0 bytes xcf/bgWoodTile.xcf | Bin 511349 -> 0 bytes xcf/goodtree1.xcf | Bin 0 -> 55512 bytes xml/bobshouse.xml | 8 +- xml/playerSpawnHill1.xml | 6 +- xml/playerSpawnHill1_Building1.xml | 6 +- xml/town.xml | 8 +- xml/town.xml.save | 11 --- 23 files changed, 27 insertions(+), 178 deletions(-) delete mode 100644 Goals.txt delete mode 100644 assets/player/maybeplayer.png delete mode 100644 assets/player/player.png delete mode 100644 assets/player/player1.png delete mode 100644 assets/player/player2.png delete mode 100644 assets/style/classic/bg/bagels.jpg delete mode 100644 assets/style/classic/bg/bagels.png delete mode 100644 assets/style/classic/bg/bgb.png delete mode 100644 assets/style/classic/bg/bgfarMountains.png delete mode 100644 assets/style/rustic/bg/bgfarMountains.png delete mode 100644 storyXML/0000_SpawnHill.xml delete mode 100644 xcf/bgTrashWaves.xcf delete mode 100644 xcf/bgWoodTile.xcf create mode 100644 xcf/goodtree1.xcf delete mode 100644 xml/town.xml.save diff --git a/Goals.txt b/Goals.txt deleted file mode 100644 index 4848bac..0000000 --- a/Goals.txt +++ /dev/null @@ -1,121 +0,0 @@ -Goals: - -End of October: -=============== - - - have textures for the world and entities (png's and stuff) - - have basic quest handling/player can interact with NPCs to take quests - - have basic mobs/animals - -Summary: - NPCs and a village were created, and a basic quest handling structure was design so that -the player could accept and complete quests from NPCs. Next we developed textures for the player, -NPCs, house and background, using PNG loading from SDL_image. After that, Andy began to work on -more textures for the game as well as animations for the player while Clyne worked on a player -inventory and rewarding items from quest completions. While these were (are) still in development -Andy added a basic template for mobs. - -End of November: -================ - - - design the game - - work on GLSL shaders to replace the current 'fake' ones - - redesign what currently exists to match what is desired - -Summary: - Textures have been formalized, with a namespace and class for loading and using textures. The -idea of a parallaxed background was applied, with up to four layers of tiled background material. -Combinations of background layers were sorted and added to the World class with a World::setBackground() -function. The inventory was created, with an animated inventory view based off of the player finished -by the end of the month. ... - -End of December: -================ - - - create first 'chapters' of story - - create very first areas in the game (code it) to get an - idea of what's gonna go down - -January - March: -=============== - - - design more story line... - - implement story line - -February - End of March: -======================== - - - design or focus on sound effects / background music? - -March-ish: -====== - - - allow friends to beta-test game - - modify game according to feedback - -April: -==== - - - remove any remaining bugs in game - - get more testing done... - - look into methods of releasing the game (steam) - -May: -==== - - - release game - -June: -===== - - - profit???? - - -******************************************************************************************************** -******************************************************************************************************** -Goals.txt before redesign: -******************************************************************************************************** -******************************************************************************************************** - -End of November: -================ - - - have a working player inventory - - receive items from things like quests and mobs - - weapons n stuff - -End of December: -================ - - - have a basic world scripter thing to script worlds - - create world saving/loading functionality - (maybe work on prettying up inventory/save-load/quest stuff) - -January - February: -=================== - - - work on a story line - -February - March: -================= - - - work on sound effects / background music - -End of March: -============= - - - Have game ready to be beta-tested by friends/other people so we can work - on receiving bug reports/adding things testers expect to have in the game. - -End of April: -============= - - - Have all major bugs found by beta testers removed/fixed - - Have the game ready for release to the public (during May the game should - be released in some form) - -End of May: -=========== - - - Have game fully deployed with a way to receive feedback from the players - diff --git a/assets/player/maybeplayer.png b/assets/player/maybeplayer.png deleted file mode 100644 index c580ff7..0000000 Binary files a/assets/player/maybeplayer.png and /dev/null differ diff --git a/assets/player/player.png b/assets/player/player.png deleted file mode 100644 index 3977092..0000000 Binary files a/assets/player/player.png and /dev/null differ diff --git a/assets/player/player1.png b/assets/player/player1.png deleted file mode 100644 index edf8bf8..0000000 Binary files a/assets/player/player1.png and /dev/null differ diff --git a/assets/player/player2.png b/assets/player/player2.png deleted file mode 100644 index cfd955f..0000000 Binary files a/assets/player/player2.png and /dev/null differ diff --git a/assets/style/classic/bg/bagels.jpg b/assets/style/classic/bg/bagels.jpg deleted file mode 100644 index fb68d2e..0000000 Binary files a/assets/style/classic/bg/bagels.jpg and /dev/null differ diff --git a/assets/style/classic/bg/bagels.png b/assets/style/classic/bg/bagels.png deleted file mode 100644 index 2ee843b..0000000 Binary files a/assets/style/classic/bg/bagels.png and /dev/null differ diff --git a/assets/style/classic/bg/bgb.png b/assets/style/classic/bg/bgb.png deleted file mode 100644 index 278e9b0..0000000 Binary files a/assets/style/classic/bg/bgb.png and /dev/null differ diff --git a/assets/style/classic/bg/bgfarMountains.png b/assets/style/classic/bg/bgfarMountains.png deleted file mode 100644 index fa6b349..0000000 Binary files a/assets/style/classic/bg/bgfarMountains.png and /dev/null differ diff --git a/assets/style/classic/bg/forestTileFront.png b/assets/style/classic/bg/forestTileFront.png index d81b2c7..1f5abb2 100644 Binary files a/assets/style/classic/bg/forestTileFront.png and b/assets/style/classic/bg/forestTileFront.png differ diff --git a/assets/style/rustic/bg/bgfarMountains.png b/assets/style/rustic/bg/bgfarMountains.png deleted file mode 100644 index fa6b349..0000000 Binary files a/assets/style/rustic/bg/bgfarMountains.png and /dev/null differ diff --git a/brice.dat b/brice.dat index 4dad711..3b090ad 100644 --- a/brice.dat +++ b/brice.dat @@ -1,7 +1,7 @@ 3 -Slow +canSprint 0 canJump 0 -canSprint +Slow 1 diff --git a/src/entities.cpp b/src/entities.cpp index cfc5922..60f49ee 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -679,7 +679,6 @@ COMMONAIFUNC: break; } while ((exml = exml->NextSiblingElement())); - std::cout << "b\n"; // handle quest tags if ((oxml = exml->FirstChildElement("quest"))) { std::string qname; @@ -733,7 +732,6 @@ COMMONAIFUNC: game::briceUpdate(); } - std::cout << "a\n"; // asdlfkj auto txml = exml->FirstChildElement("content"); if (txml == nullptr) diff --git a/src/ui.cpp b/src/ui.cpp index b484982..14df95e 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -178,7 +178,7 @@ namespace ui { unsigned char dialogOptChosen = 0; unsigned char merchOptChosen = 0; - unsigned int textWrapLimit = 110; + unsigned int textWrapLimit = 0; /* * Current font size. Changing this WILL NOT change the font size, see setFontSize() for @@ -363,24 +363,19 @@ namespace ui { */ float putString(const float x, const float y, std::string s) { - unsigned int i=0; + unsigned int i = 0, nl = 1; vec2 add, o = {x, y}; /* - * Loop on each character: - */ + * Loop on each character: + */ - do{ - if (i && ((i / 110.0) == (i / 110))) { - o.y -= fontSize * 1.05f; - o.x = x; - if (s[i] == ' ') - i++; - } + do { + if (dialogBoxExists && o.x > textWrapLimit * nl + x) { - if (i && (i / (float)textWrapLimit == i / textWrapLimit)) { o.y -= fontSize * 1.05f; o.x = x; + ++nl; // skip a space if it's there since we just newline'd if (s[i] == ' ') @@ -408,8 +403,7 @@ namespace ui { o.y += add.y; break; } - - }while(s[++i]); + } while (s[++i]); return o.x; // i.e. the string width } @@ -537,7 +531,8 @@ namespace ui { va_list dialogArgs; std::unique_ptr printfbuf (new char[512]); - textWrapLimit = 110; + textWrapLimit = game::SCREEN_WIDTH - HLINES(20); + std::cout << textWrapLimit << '\n'; dialogPassive = passive; // add speaker prefix @@ -1093,7 +1088,7 @@ namespace ui { drawNiceBox(vec2 {x, y}, vec2 {x + SCREEN_WIDTH - HLINES(16), y - SCREEN_HEIGHT / 4}, -7.0); rtext = typeOut(dialogBoxText); - putString(x + (2*game::HLINE), y - fontSize - game::HLINE, rtext); + putString(x + HLINES(2), y - fontSize - game::HLINE, rtext); for(i=0;i - - -