Resolve "Toggle Free Look with Hotkey"
[ryzomcore.git] / ryzom / client / src / client_sheets / mission_sheet.cpp
blob1f5ae9cc812309400afaf7dfeda974b082e81c2f
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 //////////////
21 // INCLUDES //
22 //////////////
23 #include "stdpch.h" // First include for pre-compiled headers.
24 // Application
25 #include "mission_sheet.h"
26 // Georges
27 #include "nel/georges/u_form_elm.h"
30 /////////////
31 // DEFINES //
32 /////////////
33 #define NB_STEPS_PER_MISSION 20
36 ///////////
37 // USING //
38 ///////////
39 using namespace NLGEORGES;
40 using namespace NLMISC;
41 using namespace std;
44 //-----------------------------------------------
45 // build :
46 // Build the sheet from an external script.
47 //-----------------------------------------------
48 void CMissionSheet::build(const NLGEORGES::UFormElm &item)
50 // Load the descriptors.
51 if(!item.getValueByName(Name, "Name"))
52 debug("key 'Name' not found.");
54 if(!item.getValueByName(Description, "Description"))
55 debug("key 'Description' not found.");
57 if(!item.getValueByName(RewardDescription, "RewardDescription"))
58 debug("key 'RewardDescription' not found.");
60 // load mission steps description
61 for (uint i =1; i< NB_STEPS_PER_MISSION + 1;i++)
63 const UFormElm * stepStruct;
64 string varName = string("step") + NLMISC::toString(i);
65 item.getNodeByName (&stepStruct, varName);
67 if (stepStruct)
69 string stepDesc;
70 stepStruct->getValueByName(stepDesc,"Description");
71 if ( !stepDesc.empty() )
72 StepsDescription.push_back(stepDesc);
76 }// build //
79 //-----------------------------------------------
80 // serial :
81 // Serialize character sheet into binary data file.
82 //-----------------------------------------------
83 void CMissionSheet::serial(NLMISC::IStream &f)
85 // Serialize class components.
86 f.serial(Name);
87 f.serial(Description);
88 f.serial(RewardDescription);
89 f.serialCont(StepsDescription);
90 }// serial //