1- #ifdef NEWINTERFACE
21#include < sstream>
32#include " ProfileViewer.h"
43#include " interface/Engine.h"
@@ -46,13 +45,6 @@ void ProfileViewer::MainLoop()
4645 delete asdf;
4746}
4847
49- std::string NumberToString (int number)
50- {
51- std::stringstream converter;
52- converter << number;
53- return converter.str ();
54- }
55-
5648void ProfileViewer::OnTick (float dt)
5749{
5850 if (profileInfoDownload && profileInfoDownload->CheckDone ())
@@ -72,18 +64,18 @@ void ProfileViewer::OnTick(float dt)
7264 ageLabel = new Label (Point (30 , 19 ), Point (Label::AUTOSIZE, Label::AUTOSIZE), root[" User" ][" Age" ].asString ());
7365 else
7466 ageLabel = new Label (Point (30 , 19 ), Point (Label::AUTOSIZE, Label::AUTOSIZE), " \b gNot Provided" );
75- if (root[" User" ][" Website" ].isString ())
76- websiteLabel = new Label (Point (50 , 31 ), Point (Label::AUTOSIZE, Label::AUTOSIZE), root[" User" ][" Website" ].asString ());
77- else
78- websiteLabel = new Label (Point (50 , 31 ), Point (Label::AUTOSIZE, Label::AUTOSIZE), " \b gNot Provided" );
7967 if (root[" User" ][" Location" ].isString ())
80- locationLabel = new Label (Point (54 , 43 ), Point (Label::AUTOSIZE, Label::AUTOSIZE), root[" User" ][" Location" ].asString ());
68+ locationLabel = new Label (Point (54 , 31 ), Point (Label::AUTOSIZE, Label::AUTOSIZE), root[" User" ][" Location" ].asString ());
69+ else
70+ locationLabel = new Label (Point (54 , 31 ), Point (Label::AUTOSIZE, Label::AUTOSIZE), " \b gNot Provided" );
71+ if (root[" User" ][" Website" ].isString ())
72+ websiteLabel = new Label (Point (50 , 43 ), Point (Label::AUTOSIZE, Label::AUTOSIZE), root[" User" ][" Website" ].asString ());
8173 else
82- locationLabel = new Label (Point (54 , 43 ), Point (Label::AUTOSIZE, Label::AUTOSIZE), " \b gNot Provided" );
74+ websiteLabel = new Label (Point (50 , 43 ), Point (Label::AUTOSIZE, Label::AUTOSIZE), " \b gNot Provided" );
8375 if (root[" User" ][" Biography" ].isString ())
84- biographyLabel = new Label (Point (8 , 103 ), Point (240 , Label::AUTOSIZE), root[" User" ][" Biography" ].asCString (), true );
76+ biographyLabel = new Label (Point (8 , 115 ), Point (240 , Label::AUTOSIZE), root[" User" ][" Biography" ].asCString (), true );
8577 else
86- biographyLabel = new Label (Point (8 , 103 ), Point (240 , Label::AUTOSIZE), " \b gNot Provided" , true );
78+ biographyLabel = new Label (Point (8 , 115 ), Point (240 , Label::AUTOSIZE), " \b gNot Provided" , true );
8779
8880 this ->AddComponent (ageLabel);
8981 this ->AddComponent (locationLabel);
@@ -105,7 +97,7 @@ void ProfileViewer::OnTick(float dt)
10597 }
10698 catch (std::exception &e)
10799 {
108- biographyLabel = new Label (Point (8 , 79 ), Point (230 , Label::AUTOSIZE), " \b rError parsing data from server" , true );
100+ biographyLabel = new Label (Point (8 , 115 ), Point (230 , Label::AUTOSIZE), " \b rError parsing data from server" , true );
109101 this ->AddComponent (biographyLabel);
110102 }
111103
@@ -138,13 +130,11 @@ void ProfileViewer::OnDraw(VideoBuffer *buf)
138130 if (avatar)
139131 buf->DrawImage (avatar, 210 , 10 , 40 , 40 );
140132 buf->DrawText (10 , 22 , " Age:" , 175 , 175 , 175 , 255 );
141- buf->DrawText (10 , 34 , " Website :" , 175 , 175 , 175 , 255 );
142- buf->DrawText (10 , 46 , " Location :" , 175 , 175 , 175 , 255 );
133+ buf->DrawText (10 , 34 , " Location :" , 175 , 175 , 175 , 255 );
134+ buf->DrawText (10 , 46 , " Website :" , 175 , 175 , 175 , 255 );
143135 buf->DrawText (10 , 58 , " Saves:" , 175 , 175 , 175 , 255 );
144136 buf->DrawText (15 , 70 , " Count:" , 175 , 175 , 175 , 255 );
145137 buf->DrawText (15 , 82 , " Average Score:" , 175 , 175 , 175 , 255 );
146138 buf->DrawText (15 , 94 , " Highest Score:" , 175 , 175 , 175 , 255 );
147139 buf->DrawText (10 , 106 , " Biography:" , 175 , 175 , 175 , 255 );
148140}
149-
150- #endif
0 commit comments