Fix css style order when using external css files
[ryzomcore.git] / ryzom / client / src / interface_v3 / group_career.cpp
blobc04d98841d2488b1b6de8b06bb2ade43d510ee02
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "stdpch.h"
24 #include "group_career.h"
25 #include "interface_manager.h"
26 #include "nel/gui/interface_element.h"
28 //#include "game_share/jobs.h"
29 #include "nel/misc/xml_auto_ptr.h"
31 using namespace std;
33 NLMISC_REGISTER_OBJECT(CViewBase, CGroupCareer, std::string, "career");
34 NLMISC_REGISTER_OBJECT(CViewBase, CGroupJob, std::string, "job");
36 // ***************************************************************************
37 bool CGroupCareer::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
39 if(!CGroupContainer::parse(cur, parentGroup))
40 return false;
42 CXMLAutoPtr ptr((const char*) xmlGetProp (cur, (xmlChar*)"career"));
44 uint careerIndex;
45 ROLES::ERole Career;
47 if (ptr)
49 NLMISC::fromString((const char*)ptr, careerIndex);
50 Career= (ROLES::ERole) careerIndex;
51 if(Career==ROLES::role_unknown)
53 nlinfo ("unknown career %s in %s", (const char*)ptr, _Id.c_str());
54 return false;
57 else
59 nlinfo ("no career in %s", _Id.c_str());
60 return false;
63 if (Career >= ROLES::NB_ROLES)
64 Career = ROLES::fighter;
66 string sTmp = ROLES::roleToUCString(Career);
67 for (uint32 i= 0; i < sTmp.size(); ++i)
68 if (sTmp[i] < 128)
69 if ( (sTmp[i] >= 'a') && (sTmp[i] <= 'z') )
70 sTmp[i] = sTmp[i] - 'a' + 'A';
72 setTitle (sTmp);
74 return true;
77 // ***************************************************************************
78 bool CGroupJob::parse (xmlNodePtr /* cur */, CInterfaceGroup * /* parentGroup */)
80 return false;
82 // if(!CGroupContainer::parse(cur, parentGroup))
83 // return false;
85 // CXMLAutoPtr ptr = (char*) xmlGetProp (cur, (xmlChar*)"career");
87 // if (ptr == NULL)
88 // return false;
90 // uint careerIndex, jobIndex;
91 // ROLES::ERole Career;
92 // JOBS::TJob Job;
94 // if (ptr)
95 // {
96 // fromString((const char*)ptr, careerIndex);
97 // Career= (ROLES::ERole) careerIndex;
98 // if(Career==ROLES::role_unknown)
99 // {
100 // nlinfo ("unknown career %s in %s", (const char*)ptr, _Id.c_str());
101 // return false;
102 // }
103 // }
104 // else
105 // {
106 // nlinfo ("no career in %s", _Id.c_str());
107 // return false;
108 // }
110 // // get job
111 // ptr = xmlGetProp (cur, (xmlChar*)"job");
112 // if (ptr)
113 // {
114 // fromString((const char*)ptr, jobIndex);
115 // if(jobIndex==-1)
116 // Job= JOBS::All;
117 // else
118 // Job= JOBS::getJobForRace((ROLES::ERole)careerIndex, (EGSPD::CPeople::TPeople)jobIndex);
119 // if(Job==JOBS::Unknown)
120 // {
121 // nlinfo ("unknown job %s in %s", (const char*)ptr, _Id.c_str());
122 // return false;
123 // }
124 // }
125 // else
126 // {
127 // nlinfo ("no job in %s", _Id.c_str());
128 // return false;
129 // }
131 // string sTmp = JOBS::jobToUCString(Job);
132 // for (uint32 i= 0; i < sTmp.size(); ++i)
133 // if (sTmp[i] < 128)
134 // if ( (sTmp[i] >= 'a') && (sTmp[i] <= 'z') )
135 // sTmp[i] = sTmp[i] - 'a' + 'A';
136 // seUCTitle (sTmp);
138 // return true;