pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src story.cxx,1.15,1.16 story.hxx,1.11,1.


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src story.cxx,1.15,1.16 story.hxx,1.11,1.12 Makefile.am,1.142,1.143 menu_button.cxx,1.6,1.7 pingus_main.cxx,1.64,1.65 story_screen.cxx,1.10,1.11 story_screen.hxx,1.3,1.4
Date: 5 Apr 2003 20:24:18 -0000

Update of /var/lib/cvs/Games/Pingus/src
In directory dark:/tmp/cvs-serv4626

Modified Files:
        Makefile.am menu_button.cxx pingus_main.cxx story_screen.cxx 
        story_screen.hxx 
Added Files:
        story.cxx story.hxx 
Log Message:
seperated intro and extro



Index: Makefile.am
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/Makefile.am,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -d -r1.142 -r1.143
--- Makefile.am 1 Apr 2003 21:54:55 -0000       1.142
+++ Makefile.am 5 Apr 2003 20:24:16 -0000       1.143
@@ -264,6 +264,8 @@
 start_screen.cxx \
 stat_manager.hxx \
 stat_manager.cxx \
+story.hxx \
+story.cxx \
 story_screen.hxx \
 story_screen.cxx \
 string_converter.cxx \

Index: menu_button.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/menu_button.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- menu_button.cxx     28 Mar 2003 13:06:55 -0000      1.6
+++ menu_button.cxx     5 Apr 2003 20:24:16 -0000       1.7
@@ -33,6 +33,7 @@
 #include "story_screen.hxx"
 #include "my_gettext.hxx"
 #include "stat_manager.hxx"
+#include "story.hxx"
 
 using EditorNS::Editor;
 
@@ -368,7 +369,7 @@
 
   if (!story_seen)
     {
-      ScreenManager::instance()->push_screen(new StoryScreen(), true);
+      ScreenManager::instance()->push_screen(new StoryScreen(Story::intro), 
true);
     }
   else
     {

Index: pingus_main.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_main.cxx,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- pingus_main.cxx     3 Apr 2003 17:03:24 -0000       1.64
+++ pingus_main.cxx     5 Apr 2003 20:24:16 -0000       1.65
@@ -87,6 +87,7 @@
 #include "credits.hxx"
 #include "sound/sound.hxx"
 #include "worldmap/manager.hxx"
+#include "story.hxx"
 #include "cheat.hxx"
 
 using EditorNS::Editor;
@@ -928,6 +929,7 @@
   SavegameManager::instance();
   StatManager::init();
  
+  Story::init();
   ScreenManager::init();
   PingusSound::init();
   PingusResource::init();

Index: story_screen.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/story_screen.cxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- story_screen.cxx    5 Apr 2003 20:08:43 -0000       1.10
+++ story_screen.cxx    5 Apr 2003 20:24:16 -0000       1.11
@@ -18,6 +18,7 @@
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include <algorithm>
+#include <vector>
 #include <ClanLib/Display/Display/surface.h>
 #include "my_gettext.hxx"
 #include "pingus_resource.hxx"
@@ -34,20 +35,6 @@
 #include "stat_manager.hxx"
 #include "sound/sound.hxx"
 
-class StoryPage
-{
-public:
-  StoryPage() {}
-
-  StoryPage(ResDescriptor arg_image, std::string arg_text)
-    : image(arg_image), text(arg_text)
-      
-  {}
-
-  ResDescriptor image;
-  std::string   text;
-};
-
 class StoryScreenComponent : public GUI::Component
 {
 private:
@@ -57,12 +44,11 @@
 
   bool page_displayed_completly;
 
-  //std::string current_page.text;
   std::vector<StoryPage> pages;
   CL_Surface page_surface;
   StoryPage  current_page;
 public:
-  StoryScreenComponent ();
+  StoryScreenComponent (const std::vector<StoryPage>&);
   virtual ~StoryScreenComponent () {}
 
   void draw (GraphicContext& gc);
@@ -94,9 +80,9 @@
 };
 
 
-StoryScreen::StoryScreen()
+StoryScreen::StoryScreen(const std::vector<StoryPage>& arg_pages)
 {
-  story_comp = new StoryScreenComponent();
+  story_comp = new StoryScreenComponent(arg_pages);
   gui_manager->add (story_comp);
   gui_manager->add (new StoryScreenContinueButton(story_comp));
 }
@@ -105,119 +91,15 @@
 {
 }
 
-StoryScreenComponent::StoryScreenComponent ()
+StoryScreenComponent::StoryScreenComponent (const std::vector<StoryPage>& 
arg_pages)
+  : pages(arg_pages)
 {
   page_displayed_completly = false;
   time_passed  = 0;
 
-  pages.push_back
-    (StoryPage
-     (ResDescriptor("Story/story0", "story"), 
-      _("For a long time now the Pingus have lived happily in peace on the\n"
-        "south pole along with all the other animals, everything was in\n"
-        "balance and it seemed like nothing could disrupt there peace.  The\n"
-        "Pingus where happy and it seemed like this could never end.\n")));
-
-  pages.push_back
-    (StoryPage
-     (ResDescriptor("Story/story1", "story"), 
-      _("But then one day, things began to change slowly, the sky got darker\n"
-        "and the earth got warmer, first of they thought this was just a\n"
-        "normal fluctuation in the worlds climate, but things seemed to get\n"
-        "worse and worse with every year.")));
-
-
-  pages.push_back
-    (StoryPage
-     (ResDescriptor("Story/story2", "story"), 
-      _("The snow began to melt away in a few regions and food became an\n"
-        "issue. Other animals already tend to leave the region to search\n"
-        "for colder areas, but the Pingus knew that this couldn't help,\n"
-        "they knew that they had to do something about this problem.")));
-
-  pages.push_back
-    (StoryPage
-     (ResDescriptor("Story/story3", "story"), 
-      _("So the circle of the eldest came together to decide what to do\n"
-        "about it. They decided to send out an expedition around the world\n"
-        "to find the cause for this warming. The expedition consisted of\n"
-        "hundreds of the bravest Pingus around on the south pole.")));
-    
-  pages.push_back
-    (StoryPage
-     (ResDescriptor("Story/story4", "story"), 
-      _("And they picked you to lead them on there journey around the\n"
-        "world. Since the journey will be dangerous and difficult. Your\n"
-        "first goal is the Island of Mogorok, also know has Tutorial\n"
-        "Island. According to the eldest, this island has always been the\n"
-        "first stop of Pingus which where send out into the world.")));
-
-  pages.push_back
-    (StoryPage
-     (ResDescriptor("Story/story5", "story"), 
-      _("The island consists of many regions which are ideally to train the\n"
-        "abilities of the Pingus. The Pingus can train there their ability\n"
-        "to build bridges, climb, bash and all the rest of there talents\n"
-        "which they will surly need on there long and dangerous journey.")));
-
-  pages.push_back
-    (StoryPage
-     (ResDescriptor("Story/story6", "story"), 
-      _("While you on the other site can practice there your ability to\n"
-        "command and guide the Pingus. You can also get familiar there with\n"
-        "all the abilities the Pingus provide and learn to master them,\n"
-        "since you will need them all for sure an your journey around the\n"
-        "world.")));
-
-  pages.push_back
-    (StoryPage
-     (ResDescriptor("Story/story6", "story"), 
-      _("Now that you and the Pingus have arrive at tutorial island it\n"
-        "is time to take over the command and begin your mission\n"
-        "\n"
-        "                                                  Good Luck!")));
-
-
-  pages.push_back
-    (StoryPage
-     (ResDescriptor("Story/credits1", "story"), 
-      _("Now after you and the Pingus have learned the basics and\n"
-        "practiced a bit it is time to move on and begin the journey into\n"
-        "the world. Since the floe with which the Pingus traveled to the\n"
-        "Tutorial Island isn't going to hold the whole way into the warmer\n"
-        "climated regions the Pingus have to find something else to guide\n"
-        "there on there journey.\n")));
-
-  pages.push_back
-    (StoryPage
-     (ResDescriptor("Story/credits2", "story"), 
-      _("But as the eldest have said, the Tutorial Island provides not\n"
-        "only a way to practive, but it is also the starting point into\n"
-        "the world, cause the wood if the large tree at the end of the\n"
-        "island is brings good wood to construct a float.\n")));
-     
-  pages.push_back
-    (StoryPage
-     (ResDescriptor("Story/credits3", "story"), 
-      _("So the Pingus set out and constructed a some large floats, enough\n"
-        "to carry them all. After also packaging up a bunch of provisions\n"
-        "they where prepared to finally start of there journey and leave\n"
-        "their familiar ground and entering the unknown parts of the\n"
-        "world.\n")));
-     
-  pages.push_back
-    (StoryPage
-     (ResDescriptor("Story/credits4", "story"), 
-      _("So the Pingus sat on there float, worrying whats to come and\n"
-        "where to go, while floating into the sunset.\n"
-        "\n"
-        "To be continued...")));
-
-    std::reverse(pages.begin(), pages.end());
-
-    current_page = pages.back();
-    page_surface = PingusResource::load_surface(current_page.image);
-    background   = PingusResource::load_surface("menu/startscreenbg", "core");
+  current_page = pages.back();
+  page_surface = PingusResource::load_surface(current_page.image);
+  background   = PingusResource::load_surface("menu/startscreenbg", "core");
 }
 
 void

Index: story_screen.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/story_screen.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- story_screen.hxx    25 Mar 2003 23:15:22 -0000      1.3
+++ story_screen.hxx    5 Apr 2003 20:24:16 -0000       1.4
@@ -20,17 +20,33 @@
 #ifndef HEADER_PINGUS_STORY_SCREEN_HXX
 #define HEADER_PINGUS_STORY_SCREEN_HXX
 
+#include <string>
+#include "res_descriptor.hxx"
 #include "gui/gui_screen.hxx"
 
 class StoryScreenComponent;
 
+class StoryPage
+{
+public:
+  StoryPage() {}
+
+  StoryPage(ResDescriptor arg_image, std::string arg_text)
+    : image(arg_image), text(arg_text)
+      
+  {}
+
+  ResDescriptor image;
+  std::string   text;
+};
+
 /** */
 class StoryScreen : public GUIScreen
 {
 private:
   StoryScreenComponent* story_comp;
 public:
-  StoryScreen();
+  StoryScreen(const std::vector<StoryPage>& pages);
   ~StoryScreen();
 
   void on_startup();





reply via email to

[Prev in Thread] Current Thread [Next in Thread]