Fix spelling of appearance
parent
6e0207ca5e
commit
19ae57c9ad
|
@ -433,8 +433,8 @@ add_library(colobotbase STATIC
|
|||
ui/particles_generator.h
|
||||
ui/screen/screen.cpp
|
||||
ui/screen/screen.h
|
||||
ui/screen/screen_apperance.cpp
|
||||
ui/screen/screen_apperance.h
|
||||
ui/screen/screen_appearance.cpp
|
||||
ui/screen/screen_appearance.h
|
||||
ui/screen/screen_io.cpp
|
||||
ui/screen/screen_io.h
|
||||
ui/screen/screen_io_read.cpp
|
||||
|
@ -521,7 +521,7 @@ if(PLATFORM_WINDOWS)
|
|||
# This should be treated as a temporary workaround
|
||||
if(USE_STATIC_RUNTIME) # Since we're using static runtime, assume every external library is static too
|
||||
find_package(Intl REQUIRED)
|
||||
|
||||
|
||||
find_library(BZ2_LIBRARY NAMES bz2)
|
||||
find_library(JPEG_LIBRARY NAMES jpeg)
|
||||
find_library(TIFF_LIBRARY NAMES tiff)
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "level/parser/parser.h"
|
||||
|
||||
|
||||
void PlayerApperance::DefPerso()
|
||||
void PlayerAppearance::DefPerso()
|
||||
{
|
||||
this->colorCombi.r = 206.0f/256.0f;
|
||||
this->colorCombi.g = 206.0f/256.0f;
|
||||
|
@ -76,7 +76,7 @@ void PlayerApperance::DefPerso()
|
|||
this->colorBand.a = 0.0f;
|
||||
}
|
||||
|
||||
void PlayerApperance::DefHairColor()
|
||||
void PlayerAppearance::DefHairColor()
|
||||
{
|
||||
if (this->face == 0) // normal ?
|
||||
{
|
||||
|
@ -122,7 +122,7 @@ CPlayerProfile::CPlayerProfile(std::string playerName)
|
|||
m_levelInfoLoaded[static_cast<LevelCategory>(i)] = false;
|
||||
}
|
||||
|
||||
LoadApperance();
|
||||
LoadAppearance();
|
||||
}
|
||||
|
||||
CPlayerProfile::~CPlayerProfile()
|
||||
|
@ -392,17 +392,17 @@ void CPlayerProfile::SaveFreeGameUnlock()
|
|||
file.close();
|
||||
}
|
||||
|
||||
// APPERANCE
|
||||
// APPEARANCE
|
||||
|
||||
PlayerApperance& CPlayerProfile::GetApperance()
|
||||
PlayerAppearance& CPlayerProfile::GetAppearance()
|
||||
{
|
||||
return m_apperance;
|
||||
return m_appearance;
|
||||
}
|
||||
|
||||
void CPlayerProfile::LoadApperance()
|
||||
void CPlayerProfile::LoadAppearance()
|
||||
{
|
||||
m_apperance.face = 0;
|
||||
m_apperance.DefPerso();
|
||||
m_appearance.face = 0;
|
||||
m_appearance.DefPerso();
|
||||
|
||||
std::string filename = GetSaveFile("face.gam");
|
||||
if (!CResourceManager::Exists(filename))
|
||||
|
@ -410,48 +410,48 @@ void CPlayerProfile::LoadApperance()
|
|||
|
||||
try
|
||||
{
|
||||
CLevelParser apperanceParser(filename);
|
||||
apperanceParser.Load();
|
||||
CLevelParser appearanceParser(filename);
|
||||
appearanceParser.Load();
|
||||
CLevelParserLine* line;
|
||||
|
||||
line = apperanceParser.Get("Head");
|
||||
m_apperance.face = line->GetParam("face")->AsInt();
|
||||
m_apperance.glasses = line->GetParam("glasses")->AsInt();
|
||||
m_apperance.colorHair = line->GetParam("hair")->AsColor();
|
||||
line = appearanceParser.Get("Head");
|
||||
m_appearance.face = line->GetParam("face")->AsInt();
|
||||
m_appearance.glasses = line->GetParam("glasses")->AsInt();
|
||||
m_appearance.colorHair = line->GetParam("hair")->AsColor();
|
||||
|
||||
line = apperanceParser.Get("Body");
|
||||
m_apperance.colorCombi = line->GetParam("combi")->AsColor();
|
||||
m_apperance.colorBand = line->GetParam("band")->AsColor();
|
||||
line = appearanceParser.Get("Body");
|
||||
m_appearance.colorCombi = line->GetParam("combi")->AsColor();
|
||||
m_appearance.colorBand = line->GetParam("band")->AsColor();
|
||||
}
|
||||
catch (CLevelParserException& e)
|
||||
{
|
||||
GetLogger()->Error("Unable to read personalized player apperance: %s\n", e.what());
|
||||
GetLogger()->Error("Unable to read personalized player appearance: %s\n", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
void CPlayerProfile::SaveApperance()
|
||||
void CPlayerProfile::SaveAppearance()
|
||||
{
|
||||
try
|
||||
{
|
||||
CLevelParser apperanceParser(GetSaveFile("face.gam"));
|
||||
CLevelParser appearanceParser(GetSaveFile("face.gam"));
|
||||
CLevelParserLineUPtr line;
|
||||
|
||||
line = MakeUnique<CLevelParserLine>("Head");
|
||||
line->AddParam("face", MakeUnique<CLevelParserParam>(m_apperance.face));
|
||||
line->AddParam("glasses", MakeUnique<CLevelParserParam>(m_apperance.glasses));
|
||||
line->AddParam("hair", MakeUnique<CLevelParserParam>(m_apperance.colorHair));
|
||||
apperanceParser.AddLine(std::move(line));
|
||||
line->AddParam("face", MakeUnique<CLevelParserParam>(m_appearance.face));
|
||||
line->AddParam("glasses", MakeUnique<CLevelParserParam>(m_appearance.glasses));
|
||||
line->AddParam("hair", MakeUnique<CLevelParserParam>(m_appearance.colorHair));
|
||||
appearanceParser.AddLine(std::move(line));
|
||||
|
||||
line = MakeUnique<CLevelParserLine>("Body");
|
||||
line->AddParam("combi", MakeUnique<CLevelParserParam>(m_apperance.colorCombi));
|
||||
line->AddParam("band", MakeUnique<CLevelParserParam>(m_apperance.colorBand));
|
||||
apperanceParser.AddLine(std::move(line));
|
||||
line->AddParam("combi", MakeUnique<CLevelParserParam>(m_appearance.colorCombi));
|
||||
line->AddParam("band", MakeUnique<CLevelParserParam>(m_appearance.colorBand));
|
||||
appearanceParser.AddLine(std::move(line));
|
||||
|
||||
apperanceParser.Save();
|
||||
appearanceParser.Save();
|
||||
}
|
||||
catch (CLevelParserException& e)
|
||||
{
|
||||
GetLogger()->Error("Unable to write personalized player apperance: %s\n", e.what());
|
||||
GetLogger()->Error("Unable to write personalized player appearance: %s\n", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -553,7 +553,7 @@ void CPlayerProfile::LoadScene(std::string dir)
|
|||
}
|
||||
else
|
||||
{
|
||||
// Backwards combatibility
|
||||
// Backwards compatibility
|
||||
chap = rank/100;
|
||||
rank = rank%100;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ struct LevelInfo
|
|||
bool bPassed = false;
|
||||
};
|
||||
|
||||
struct PlayerApperance
|
||||
struct PlayerAppearance
|
||||
{
|
||||
int face = 0; // face
|
||||
int glasses = 0; // glasses
|
||||
|
@ -108,12 +108,12 @@ public:
|
|||
//! Saves unlocked DoneResearch for free game
|
||||
void SetFreeGameResearchUnlock(int freeResearch);
|
||||
|
||||
//! Returns a reference to PlayerApperance structure
|
||||
PlayerApperance& GetApperance();
|
||||
//! Loads PlayerApperance structure
|
||||
void LoadApperance();
|
||||
//! Saves PlayerApperance structure
|
||||
void SaveApperance();
|
||||
//! Returns a reference to PlayerAppearance structure
|
||||
PlayerAppearance& GetAppearance();
|
||||
//! Loads PlayerAppearance structure
|
||||
void LoadAppearance();
|
||||
//! Saves PlayerAppearance structure
|
||||
void SaveAppearance();
|
||||
|
||||
//! Returns true if player has at least one saved scene
|
||||
bool HasAnySavedScene();
|
||||
|
@ -157,6 +157,6 @@ protected:
|
|||
//! Researches unlocked for free game
|
||||
int m_freegameResearch;
|
||||
|
||||
//! Player apperance
|
||||
PlayerApperance m_apperance;
|
||||
//! Player appearance
|
||||
PlayerAppearance m_appearance;
|
||||
};
|
||||
|
|
|
@ -317,7 +317,7 @@ std::string PhaseToString(Phase phase)
|
|||
if (phase == PHASE_WELCOME2) return "PHASE_WELCOME2";
|
||||
if (phase == PHASE_WELCOME3) return "PHASE_WELCOME3";
|
||||
if (phase == PHASE_PLAYER_SELECT) return "PHASE_PLAYER_SELECT";
|
||||
if (phase == PHASE_APPERANCE) return "PHASE_APPERANCE";
|
||||
if (phase == PHASE_APPEARANCE) return "PHASE_APPEARANCE";
|
||||
if (phase == PHASE_MAIN_MENU) return "PHASE_MAIN_MENU";
|
||||
if (phase == PHASE_LEVEL_LIST) return "PHASE_LEVEL_LIST";
|
||||
if (phase == PHASE_MOD_LIST) return "PHASE_MOD_LIST";
|
||||
|
@ -352,14 +352,14 @@ bool IsPhaseWithWorld(Phase phase)
|
|||
if (phase == PHASE_SIMUL ) return true;
|
||||
if (phase == PHASE_WIN ) return true;
|
||||
if (phase == PHASE_LOST ) return true;
|
||||
if (phase == PHASE_APPERANCE) return true;
|
||||
if (phase == PHASE_APPEARANCE) return true;
|
||||
if (IsInSimulationConfigPhase(phase)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsMainMenuPhase(Phase phase)
|
||||
{
|
||||
if (phase == PHASE_APPERANCE) return true;
|
||||
if (phase == PHASE_APPEARANCE) return true;
|
||||
return !IsPhaseWithWorld(phase);
|
||||
}
|
||||
|
||||
|
@ -531,7 +531,7 @@ void CRobotMain::ChangePhase(Phase phase)
|
|||
float sx = (32.0f+2.0f)/640.0f;
|
||||
float sy = (32.0f+2.0f)/480.0f;
|
||||
|
||||
if (m_phase != PHASE_APPERANCE)
|
||||
if (m_phase != PHASE_APPEARANCE)
|
||||
{
|
||||
m_engine->SetDrawWorld(true);
|
||||
m_engine->SetDrawFront(false);
|
||||
|
@ -1162,7 +1162,7 @@ bool CRobotMain::ProcessEvent(Event &event)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (m_phase == PHASE_APPERANCE)
|
||||
if (m_phase == PHASE_APPEARANCE)
|
||||
EventObject(event);
|
||||
|
||||
if (m_phase == PHASE_WIN ||
|
||||
|
@ -2080,7 +2080,7 @@ void CRobotMain::HiliteClear()
|
|||
//! Highlights the object with the mouse hovers over
|
||||
void CRobotMain::HiliteObject(Math::Point pos)
|
||||
{
|
||||
if (m_fixScene && m_phase != PHASE_APPERANCE) return;
|
||||
if (m_fixScene && m_phase != PHASE_APPEARANCE) return;
|
||||
if (m_movieLock) return;
|
||||
if (m_movie->IsExist()) return;
|
||||
if (m_app->GetMouseMode() == MOUSE_NONE) return;
|
||||
|
@ -2146,7 +2146,7 @@ void CRobotMain::HiliteObject(Math::Point pos)
|
|||
//! Highlights the object with the mouse hovers over
|
||||
void CRobotMain::HiliteFrame(float rTime)
|
||||
{
|
||||
if (m_fixScene && m_phase != PHASE_APPERANCE) return;
|
||||
if (m_fixScene && m_phase != PHASE_APPEARANCE) return;
|
||||
if (m_movieLock) return;
|
||||
if (m_movie->IsExist()) return;
|
||||
|
||||
|
@ -2429,7 +2429,7 @@ bool CRobotMain::EventFrame(const Event &event)
|
|||
if (m_engine->GetFog())
|
||||
m_camera->SetOverBaseColor(m_particle->GetFogColor(m_engine->GetEyePt()));
|
||||
}
|
||||
if (m_phase == PHASE_APPERANCE ||
|
||||
if (m_phase == PHASE_APPEARANCE ||
|
||||
m_phase == PHASE_WIN ||
|
||||
m_phase == PHASE_LOST)
|
||||
{
|
||||
|
@ -2702,7 +2702,7 @@ void CRobotMain::ScenePerso()
|
|||
}
|
||||
catch (const std::runtime_error& e)
|
||||
{
|
||||
LevelLoadingError("An error occurred while trying to load apperance scene", e, PHASE_PLAYER_SELECT);
|
||||
LevelLoadingError("An error occurred while trying to load appearance scene", e, PHASE_PLAYER_SELECT);
|
||||
}
|
||||
|
||||
m_engine->SetDrawWorld(false); // does not draw anything on the interface
|
||||
|
@ -3924,7 +3924,7 @@ void CRobotMain::ChangeColor()
|
|||
m_phase != PHASE_MOD_LIST &&
|
||||
m_phase != PHASE_WIN &&
|
||||
m_phase != PHASE_LOST &&
|
||||
m_phase != PHASE_APPERANCE ) return;
|
||||
m_phase != PHASE_APPEARANCE ) return;
|
||||
|
||||
// Player texture
|
||||
|
||||
|
@ -3939,11 +3939,11 @@ void CRobotMain::ChangeColor()
|
|||
colorRef1.r = 206.0f/256.0f;
|
||||
colorRef1.g = 206.0f/256.0f;
|
||||
colorRef1.b = 204.0f/256.0f; // ~white
|
||||
colorNew1 = m_playerProfile->GetApperance().colorCombi;
|
||||
colorNew1 = m_playerProfile->GetAppearance().colorCombi;
|
||||
colorRef2.r = 255.0f/256.0f;
|
||||
colorRef2.g = 132.0f/256.0f;
|
||||
colorRef2.b = 1.0f/256.0f; // orange
|
||||
colorNew2 = m_playerProfile->GetApperance().colorBand;
|
||||
colorNew2 = m_playerProfile->GetAppearance().colorBand;
|
||||
|
||||
Math::Point exclu[6];
|
||||
exclu[0] = Math::Point(192.0f/256.0f, 0.0f/256.0f);
|
||||
|
@ -3985,7 +3985,7 @@ void CRobotMain::ChangeColor()
|
|||
colorRef1.b = 0.0f/256.0f; // yellow
|
||||
tolerance = 0.20f;
|
||||
}
|
||||
colorNew1 = m_playerProfile->GetApperance().colorHair;
|
||||
colorNew1 = m_playerProfile->GetAppearance().colorHair;
|
||||
colorRef2.r = 0.0f;
|
||||
colorRef2.g = 0.0f;
|
||||
colorRef2.b = 0.0f;
|
||||
|
@ -5425,13 +5425,13 @@ MissionType CRobotMain::GetMissionType()
|
|||
//! Returns the representation to use for the player
|
||||
int CRobotMain::GetGamerFace()
|
||||
{
|
||||
return m_playerProfile->GetApperance().face;
|
||||
return m_playerProfile->GetAppearance().face;
|
||||
}
|
||||
|
||||
//! Returns the representation to use for the player
|
||||
int CRobotMain::GetGamerGlasses()
|
||||
{
|
||||
return m_playerProfile->GetApperance().glasses;
|
||||
return m_playerProfile->GetAppearance().glasses;
|
||||
}
|
||||
|
||||
//! Returns the mode with just the head
|
||||
|
|
|
@ -52,7 +52,7 @@ enum Phase
|
|||
PHASE_WELCOME2,
|
||||
PHASE_WELCOME3,
|
||||
PHASE_PLAYER_SELECT,
|
||||
PHASE_APPERANCE,
|
||||
PHASE_APPEARANCE,
|
||||
PHASE_MAIN_MENU,
|
||||
PHASE_LEVEL_LIST,
|
||||
PHASE_MOD_LIST,
|
||||
|
@ -198,7 +198,7 @@ public:
|
|||
Phase GetPhase();
|
||||
//@}
|
||||
|
||||
//! Load the scene for apperance customization
|
||||
//! Load the scene for appearance customization
|
||||
void ScenePerso();
|
||||
|
||||
void SetMovieLock(bool lock);
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include "ui/controls/window.h"
|
||||
|
||||
#include "ui/screen/screen.h"
|
||||
#include "ui/screen/screen_apperance.h"
|
||||
#include "ui/screen/screen_appearance.h"
|
||||
#include "ui/screen/screen_io_read.h"
|
||||
#include "ui/screen/screen_io_write.h"
|
||||
#include "ui/screen/screen_level_list.h"
|
||||
|
@ -76,7 +76,7 @@ CMainUserInterface::CMainUserInterface()
|
|||
|
||||
m_dialog = MakeUnique<CMainDialog>();
|
||||
|
||||
m_screenAppearance = MakeUnique<CScreenApperance>();
|
||||
m_screenAppearance = MakeUnique<CScreenAppearance>();
|
||||
m_screenLevelList = MakeUnique<CScreenLevelList>(m_dialog.get());
|
||||
m_screenIORead = MakeUnique<CScreenIORead>(m_screenLevelList.get());
|
||||
m_screenIOWrite = MakeUnique<CScreenIOWrite>(m_screenLevelList.get());
|
||||
|
@ -173,7 +173,7 @@ void CMainUserInterface::ChangePhase(Phase phase)
|
|||
{
|
||||
m_currentScreen = m_screenPlayerSelect.get();
|
||||
}
|
||||
if (m_phase == PHASE_APPERANCE)
|
||||
if (m_phase == PHASE_APPEARANCE)
|
||||
{
|
||||
m_currentScreen = m_screenAppearance.get();
|
||||
}
|
||||
|
@ -786,7 +786,7 @@ bool CMainUserInterface::GetPlusExplorer()
|
|||
|
||||
bool CMainUserInterface::GetGamerOnlyHead()
|
||||
{
|
||||
if (m_phase == PHASE_APPERANCE)
|
||||
if (m_phase == PHASE_APPEARANCE)
|
||||
return m_screenAppearance->GetGamerOnlyHead();
|
||||
|
||||
return false;
|
||||
|
@ -794,7 +794,7 @@ bool CMainUserInterface::GetGamerOnlyHead()
|
|||
|
||||
float CMainUserInterface::GetPersoAngle()
|
||||
{
|
||||
if (m_phase == PHASE_APPERANCE)
|
||||
if (m_phase == PHASE_APPEARANCE)
|
||||
return m_screenAppearance->GetPersoAngle();
|
||||
|
||||
return 0.0f;
|
||||
|
|
|
@ -44,7 +44,7 @@ class CInterface;
|
|||
class CMainDialog;
|
||||
|
||||
class CScreen;
|
||||
class CScreenApperance;
|
||||
class CScreenAppearance;
|
||||
class CScreenIORead;
|
||||
class CScreenIOWrite;
|
||||
class CScreenLevelList;
|
||||
|
@ -112,7 +112,7 @@ protected:
|
|||
std::unique_ptr<CMainDialog> m_dialog;
|
||||
|
||||
CScreen* m_currentScreen;
|
||||
std::unique_ptr<CScreenApperance> m_screenAppearance;
|
||||
std::unique_ptr<CScreenAppearance> m_screenAppearance;
|
||||
std::unique_ptr<CScreenIORead> m_screenIORead;
|
||||
std::unique_ptr<CScreenIOWrite> m_screenIOWrite;
|
||||
std::unique_ptr<CScreenLevelList> m_screenLevelList;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* along with this program. If not, see http://gnu.org/licenses
|
||||
*/
|
||||
|
||||
#include "ui/screen/screen_apperance.h"
|
||||
#include "ui/screen/screen_appearance.h"
|
||||
|
||||
#include "app/app.h"
|
||||
|
||||
|
@ -77,13 +77,13 @@ const int PERSO_COLOR[3*10*3] =
|
|||
0, 0, 0, //
|
||||
};
|
||||
|
||||
CScreenApperance::CScreenApperance()
|
||||
: m_apperanceTab(0),
|
||||
m_apperanceAngle(0.0f)
|
||||
CScreenAppearance::CScreenAppearance()
|
||||
: m_appearanceTab(0),
|
||||
m_appearanceAngle(0.0f)
|
||||
{
|
||||
}
|
||||
|
||||
void CScreenApperance::CreateInterface()
|
||||
void CScreenAppearance::CreateInterface()
|
||||
{
|
||||
CWindow* pw;
|
||||
CLabel* pl;
|
||||
|
@ -305,17 +305,17 @@ void CScreenApperance::CreateInterface()
|
|||
pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_PDEF);
|
||||
pb->SetState(STATE_SHADOW);
|
||||
|
||||
m_apperanceTab = 0;
|
||||
m_apperanceAngle = -0.6f;
|
||||
m_main->GetPlayerProfile()->LoadApperance();
|
||||
m_appearanceTab = 0;
|
||||
m_appearanceAngle = -0.6f;
|
||||
m_main->GetPlayerProfile()->LoadAppearance();
|
||||
UpdatePerso();
|
||||
m_main->ScenePerso();
|
||||
CameraPerso();
|
||||
}
|
||||
|
||||
bool CScreenApperance::EventProcess(const Event &event)
|
||||
bool CScreenAppearance::EventProcess(const Event &event)
|
||||
{
|
||||
PlayerApperance& apperance = m_main->GetPlayerProfile()->GetApperance();
|
||||
PlayerAppearance& appearance = m_main->GetPlayerProfile()->GetAppearance();
|
||||
switch( event.type )
|
||||
{
|
||||
case EVENT_KEY_DOWN:
|
||||
|
@ -338,13 +338,13 @@ bool CScreenApperance::EventProcess(const Event &event)
|
|||
break;
|
||||
|
||||
case EVENT_INTERFACE_PHEAD:
|
||||
m_apperanceTab = 0;
|
||||
m_appearanceTab = 0;
|
||||
UpdatePerso();
|
||||
m_main->ScenePerso();
|
||||
CameraPerso();
|
||||
break;
|
||||
case EVENT_INTERFACE_PBODY:
|
||||
m_apperanceTab = 1;
|
||||
m_appearanceTab = 1;
|
||||
UpdatePerso();
|
||||
m_main->ScenePerso();
|
||||
CameraPerso();
|
||||
|
@ -354,8 +354,8 @@ bool CScreenApperance::EventProcess(const Event &event)
|
|||
case EVENT_INTERFACE_PFACE2:
|
||||
case EVENT_INTERFACE_PFACE3:
|
||||
case EVENT_INTERFACE_PFACE4:
|
||||
apperance.face = event.type-EVENT_INTERFACE_PFACE1;
|
||||
apperance.DefHairColor();
|
||||
appearance.face = event.type-EVENT_INTERFACE_PFACE1;
|
||||
appearance.DefHairColor();
|
||||
UpdatePerso();
|
||||
m_main->ScenePerso();
|
||||
break;
|
||||
|
@ -370,7 +370,7 @@ bool CScreenApperance::EventProcess(const Event &event)
|
|||
case EVENT_INTERFACE_PGLASS7:
|
||||
case EVENT_INTERFACE_PGLASS8:
|
||||
case EVENT_INTERFACE_PGLASS9:
|
||||
apperance.glasses = event.type-EVENT_INTERFACE_PGLASS0;
|
||||
appearance.glasses = event.type-EVENT_INTERFACE_PGLASS0;
|
||||
UpdatePerso();
|
||||
m_main->ScenePerso();
|
||||
break;
|
||||
|
@ -417,25 +417,25 @@ bool CScreenApperance::EventProcess(const Event &event)
|
|||
break;
|
||||
|
||||
case EVENT_INTERFACE_PDEF:
|
||||
apperance.DefPerso();
|
||||
appearance.DefPerso();
|
||||
UpdatePerso();
|
||||
m_main->ScenePerso();
|
||||
break;
|
||||
|
||||
case EVENT_INTERFACE_PLROT:
|
||||
m_apperanceAngle += 0.2f;
|
||||
m_appearanceAngle += 0.2f;
|
||||
break;
|
||||
case EVENT_INTERFACE_PRROT:
|
||||
m_apperanceAngle -= 0.2f;
|
||||
m_appearanceAngle -= 0.2f;
|
||||
break;
|
||||
|
||||
case EVENT_INTERFACE_POK:
|
||||
m_main->GetPlayerProfile()->SaveApperance();
|
||||
m_main->GetPlayerProfile()->SaveAppearance();
|
||||
m_main->ChangePhase(PHASE_MAIN_MENU);
|
||||
break;
|
||||
|
||||
case EVENT_INTERFACE_PCANCEL:
|
||||
m_main->GetPlayerProfile()->LoadApperance(); // reload apperance from file
|
||||
m_main->GetPlayerProfile()->LoadAppearance(); // reload appearance from file
|
||||
m_main->ChangePhase(PHASE_PLAYER_SELECT);
|
||||
break;
|
||||
|
||||
|
@ -445,14 +445,14 @@ bool CScreenApperance::EventProcess(const Event &event)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool CScreenApperance::GetGamerOnlyHead()
|
||||
bool CScreenAppearance::GetGamerOnlyHead()
|
||||
{
|
||||
return m_apperanceTab == 0;
|
||||
return m_appearanceTab == 0;
|
||||
}
|
||||
|
||||
float CScreenApperance::GetPersoAngle()
|
||||
float CScreenAppearance::GetPersoAngle()
|
||||
{
|
||||
return m_apperanceAngle;
|
||||
return m_appearanceAngle;
|
||||
}
|
||||
|
||||
// Tests whether two colors are equal or nearly are.
|
||||
|
@ -466,7 +466,7 @@ static bool EqColor(const Gfx::Color &c1, const Gfx::Color &c2)
|
|||
|
||||
// Updates all the buttons for the character.
|
||||
|
||||
void CScreenApperance::UpdatePerso()
|
||||
void CScreenAppearance::UpdatePerso()
|
||||
{
|
||||
CWindow* pw;
|
||||
CLabel* pl;
|
||||
|
@ -477,7 +477,7 @@ void CScreenApperance::UpdatePerso()
|
|||
std::string name;
|
||||
int i;
|
||||
|
||||
PlayerApperance& apperance = m_main->GetPlayerProfile()->GetApperance();
|
||||
PlayerAppearance& appearance = m_main->GetPlayerProfile()->GetAppearance();
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == nullptr ) return;
|
||||
|
@ -485,18 +485,18 @@ void CScreenApperance::UpdatePerso()
|
|||
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_PHEAD));
|
||||
if ( pb != nullptr )
|
||||
{
|
||||
pb->SetState(STATE_CHECK, m_apperanceTab==0);
|
||||
pb->SetState(STATE_CHECK, m_appearanceTab==0);
|
||||
}
|
||||
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_PBODY));
|
||||
if ( pb != nullptr )
|
||||
{
|
||||
pb->SetState(STATE_CHECK, m_apperanceTab==1);
|
||||
pb->SetState(STATE_CHECK, m_appearanceTab==1);
|
||||
}
|
||||
|
||||
pl = static_cast<CLabel*>(pw->SearchControl(EVENT_LABEL11));
|
||||
if ( pl != nullptr )
|
||||
{
|
||||
if ( m_apperanceTab == 0 )
|
||||
if ( m_appearanceTab == 0 )
|
||||
{
|
||||
pl->SetState(STATE_VISIBLE);
|
||||
GetResource(RES_TEXT, RT_PERSO_FACE, name);
|
||||
|
@ -511,7 +511,7 @@ void CScreenApperance::UpdatePerso()
|
|||
pl = static_cast<CLabel*>(pw->SearchControl(EVENT_LABEL12));
|
||||
if ( pl != nullptr )
|
||||
{
|
||||
if ( m_apperanceTab == 0 )
|
||||
if ( m_appearanceTab == 0 )
|
||||
{
|
||||
pl->SetState(STATE_VISIBLE);
|
||||
GetResource(RES_TEXT, RT_PERSO_GLASSES, name);
|
||||
|
@ -526,7 +526,7 @@ void CScreenApperance::UpdatePerso()
|
|||
pl = static_cast<CLabel*>(pw->SearchControl(EVENT_LABEL13));
|
||||
if ( pl != nullptr )
|
||||
{
|
||||
if ( m_apperanceTab == 0 ) GetResource(RES_TEXT, RT_PERSO_HAIR, name);
|
||||
if ( m_appearanceTab == 0 ) GetResource(RES_TEXT, RT_PERSO_HAIR, name);
|
||||
else GetResource(RES_TEXT, RT_PERSO_BAND, name);
|
||||
pl->SetName(name);
|
||||
}
|
||||
|
@ -534,7 +534,7 @@ void CScreenApperance::UpdatePerso()
|
|||
pl = static_cast<CLabel*>(pw->SearchControl(EVENT_LABEL14));
|
||||
if ( pl != nullptr )
|
||||
{
|
||||
if ( m_apperanceTab == 0 )
|
||||
if ( m_appearanceTab == 0 )
|
||||
{
|
||||
pl->ClearState(STATE_VISIBLE);
|
||||
}
|
||||
|
@ -550,23 +550,23 @@ void CScreenApperance::UpdatePerso()
|
|||
{
|
||||
pb = static_cast<CButton*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PFACE1+i)));
|
||||
if ( pb == nullptr ) break;
|
||||
pb->SetState(STATE_VISIBLE, m_apperanceTab==0);
|
||||
pb->SetState(STATE_CHECK, i==apperance.face);
|
||||
pb->SetState(STATE_VISIBLE, m_appearanceTab==0);
|
||||
pb->SetState(STATE_CHECK, i==appearance.face);
|
||||
}
|
||||
|
||||
for ( i=0 ; i<10 ; i++ )
|
||||
{
|
||||
pb = static_cast<CButton*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PGLASS0+i)));
|
||||
if ( pb == nullptr ) break;
|
||||
pb->SetState(STATE_VISIBLE, m_apperanceTab==0);
|
||||
pb->SetState(STATE_CHECK, i==apperance.glasses);
|
||||
pb->SetState(STATE_VISIBLE, m_appearanceTab==0);
|
||||
pb->SetState(STATE_CHECK, i==appearance.glasses);
|
||||
}
|
||||
|
||||
for ( i=0 ; i<3*3 ; i++ )
|
||||
{
|
||||
pc = static_cast<CColor*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PC0a+i)));
|
||||
if ( pc == nullptr ) break;
|
||||
if ( m_apperanceTab == 0 )
|
||||
if ( m_appearanceTab == 0 )
|
||||
{
|
||||
pc->ClearState(STATE_VISIBLE);
|
||||
}
|
||||
|
@ -578,29 +578,29 @@ void CScreenApperance::UpdatePerso()
|
|||
color.b = PERSO_COLOR[3*10*1+3*i+2]/255.0f;
|
||||
color.a = 0.0f;
|
||||
pc->SetColor(color);
|
||||
pc->SetState(STATE_CHECK, EqColor(color, apperance.colorCombi));
|
||||
pc->SetState(STATE_CHECK, EqColor(color, appearance.colorCombi));
|
||||
}
|
||||
|
||||
pc = static_cast<CColor*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PC0b+i)));
|
||||
if ( pc == nullptr ) break;
|
||||
color.r = PERSO_COLOR[3*10*2*m_apperanceTab+3*i+0]/255.0f;
|
||||
color.g = PERSO_COLOR[3*10*2*m_apperanceTab+3*i+1]/255.0f;
|
||||
color.b = PERSO_COLOR[3*10*2*m_apperanceTab+3*i+2]/255.0f;
|
||||
color.r = PERSO_COLOR[3*10*2*m_appearanceTab+3*i+0]/255.0f;
|
||||
color.g = PERSO_COLOR[3*10*2*m_appearanceTab+3*i+1]/255.0f;
|
||||
color.b = PERSO_COLOR[3*10*2*m_appearanceTab+3*i+2]/255.0f;
|
||||
color.a = 0.0f;
|
||||
pc->SetColor(color);
|
||||
pc->SetState(STATE_CHECK, EqColor(color, m_apperanceTab?apperance.colorBand:apperance.colorHair));
|
||||
pc->SetState(STATE_CHECK, EqColor(color, m_appearanceTab?appearance.colorBand:appearance.colorHair));
|
||||
}
|
||||
|
||||
for ( i=0 ; i<3 ; i++ )
|
||||
{
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PCRa+i)));
|
||||
if ( ps == nullptr ) break;
|
||||
ps->SetState(STATE_VISIBLE, m_apperanceTab==1);
|
||||
ps->SetState(STATE_VISIBLE, m_appearanceTab==1);
|
||||
}
|
||||
|
||||
if ( m_apperanceTab == 1 )
|
||||
if ( m_appearanceTab == 1 )
|
||||
{
|
||||
color = apperance.colorCombi;
|
||||
color = appearance.colorCombi;
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCRa));
|
||||
if ( ps != nullptr ) ps->SetVisibleValue(color.r*255.0f);
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCGa));
|
||||
|
@ -609,8 +609,8 @@ void CScreenApperance::UpdatePerso()
|
|||
if ( ps != nullptr ) ps->SetVisibleValue(color.b*255.0f);
|
||||
}
|
||||
|
||||
if ( m_apperanceTab == 0 ) color = apperance.colorHair;
|
||||
else color = apperance.colorBand;
|
||||
if ( m_appearanceTab == 0 ) color = appearance.colorHair;
|
||||
else color = appearance.colorBand;
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCRb));
|
||||
if ( ps != nullptr ) ps->SetVisibleValue(color.r*255.0f);
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCGb));
|
||||
|
@ -621,9 +621,9 @@ void CScreenApperance::UpdatePerso()
|
|||
|
||||
// Updates the camera for the character.
|
||||
|
||||
void CScreenApperance::CameraPerso()
|
||||
void CScreenAppearance::CameraPerso()
|
||||
{
|
||||
if ( m_apperanceTab == 0 )
|
||||
if ( m_appearanceTab == 0 )
|
||||
{
|
||||
SetCamera(0.325f, -0.15f, 5.0f);
|
||||
}
|
||||
|
@ -635,44 +635,44 @@ void CScreenApperance::CameraPerso()
|
|||
|
||||
// Sets a fixed color.
|
||||
|
||||
void CScreenApperance::FixPerso(int rank, int index)
|
||||
void CScreenAppearance::FixPerso(int rank, int index)
|
||||
{
|
||||
PlayerApperance& apperance = m_main->GetPlayerProfile()->GetApperance();
|
||||
if ( m_apperanceTab == 0 )
|
||||
PlayerAppearance& appearance = m_main->GetPlayerProfile()->GetAppearance();
|
||||
if ( m_appearanceTab == 0 )
|
||||
{
|
||||
if ( index == 1 )
|
||||
{
|
||||
apperance.colorHair.r = PERSO_COLOR[3*10*0+rank*3+0]/255.0f;
|
||||
apperance.colorHair.g = PERSO_COLOR[3*10*0+rank*3+1]/255.0f;
|
||||
apperance.colorHair.b = PERSO_COLOR[3*10*0+rank*3+2]/255.0f;
|
||||
appearance.colorHair.r = PERSO_COLOR[3*10*0+rank*3+0]/255.0f;
|
||||
appearance.colorHair.g = PERSO_COLOR[3*10*0+rank*3+1]/255.0f;
|
||||
appearance.colorHair.b = PERSO_COLOR[3*10*0+rank*3+2]/255.0f;
|
||||
}
|
||||
}
|
||||
if ( m_apperanceTab == 1 )
|
||||
if ( m_appearanceTab == 1 )
|
||||
{
|
||||
if ( index == 0 )
|
||||
{
|
||||
apperance.colorCombi.r = PERSO_COLOR[3*10*1+rank*3+0]/255.0f;
|
||||
apperance.colorCombi.g = PERSO_COLOR[3*10*1+rank*3+1]/255.0f;
|
||||
apperance.colorCombi.b = PERSO_COLOR[3*10*1+rank*3+2]/255.0f;
|
||||
appearance.colorCombi.r = PERSO_COLOR[3*10*1+rank*3+0]/255.0f;
|
||||
appearance.colorCombi.g = PERSO_COLOR[3*10*1+rank*3+1]/255.0f;
|
||||
appearance.colorCombi.b = PERSO_COLOR[3*10*1+rank*3+2]/255.0f;
|
||||
}
|
||||
if ( index == 1 )
|
||||
{
|
||||
apperance.colorBand.r = PERSO_COLOR[3*10*2+rank*3+0]/255.0f;
|
||||
apperance.colorBand.g = PERSO_COLOR[3*10*2+rank*3+1]/255.0f;
|
||||
apperance.colorBand.b = PERSO_COLOR[3*10*2+rank*3+2]/255.0f;
|
||||
appearance.colorBand.r = PERSO_COLOR[3*10*2+rank*3+0]/255.0f;
|
||||
appearance.colorBand.g = PERSO_COLOR[3*10*2+rank*3+1]/255.0f;
|
||||
appearance.colorBand.b = PERSO_COLOR[3*10*2+rank*3+2]/255.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Updates the color of the character.
|
||||
|
||||
void CScreenApperance::ColorPerso()
|
||||
void CScreenAppearance::ColorPerso()
|
||||
{
|
||||
CWindow* pw;
|
||||
CSlider* ps;
|
||||
Gfx::Color color;
|
||||
|
||||
PlayerApperance& apperance = m_main->GetPlayerProfile()->GetApperance();
|
||||
PlayerAppearance& appearance = m_main->GetPlayerProfile()->GetAppearance();
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == nullptr ) return;
|
||||
|
@ -685,7 +685,7 @@ void CScreenApperance::ColorPerso()
|
|||
if ( ps != nullptr ) color.g = ps->GetVisibleValue()/255.0f;
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCBa));
|
||||
if ( ps != nullptr ) color.b = ps->GetVisibleValue()/255.0f;
|
||||
if ( m_apperanceTab == 1 ) apperance.colorCombi = color;
|
||||
if ( m_appearanceTab == 1 ) appearance.colorCombi = color;
|
||||
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCRb));
|
||||
if ( ps != nullptr ) color.r = ps->GetVisibleValue()/255.0f;
|
||||
|
@ -693,11 +693,11 @@ void CScreenApperance::ColorPerso()
|
|||
if ( ps != nullptr ) color.g = ps->GetVisibleValue()/255.0f;
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCBb));
|
||||
if ( ps != nullptr ) color.b = ps->GetVisibleValue()/255.0f;
|
||||
if ( m_apperanceTab == 0 ) apperance.colorHair = color;
|
||||
else apperance.colorBand = color;
|
||||
if ( m_appearanceTab == 0 ) appearance.colorHair = color;
|
||||
else appearance.colorBand = color;
|
||||
}
|
||||
|
||||
void CScreenApperance::SetCamera(float x, float y, float cameraDistance)
|
||||
void CScreenAppearance::SetCamera(float x, float y, float cameraDistance)
|
||||
{
|
||||
Gfx::CCamera* camera = m_main->GetCamera();
|
||||
Gfx::CEngine* engine = Gfx::CEngine::GetInstancePointer();
|
|
@ -24,10 +24,10 @@
|
|||
namespace Ui
|
||||
{
|
||||
|
||||
class CScreenApperance : public CScreen
|
||||
class CScreenAppearance : public CScreen
|
||||
{
|
||||
public:
|
||||
CScreenApperance();
|
||||
CScreenAppearance();
|
||||
void CreateInterface() override;
|
||||
bool EventProcess(const Event &event) override;
|
||||
|
||||
|
@ -44,8 +44,8 @@ protected:
|
|||
void SetCamera(float x, float y, float cameraDistance);
|
||||
|
||||
protected:
|
||||
int m_apperanceTab; // perso: tab selected
|
||||
float m_apperanceAngle; // perso: angle of presentation
|
||||
int m_appearanceTab; // perso: tab selected
|
||||
float m_appearanceAngle; // perso: angle of presentation
|
||||
};
|
||||
|
||||
} // namespace Ui
|
|
@ -183,7 +183,7 @@ bool CScreenPlayerSelect::EventProcess(const Event &event)
|
|||
|
||||
case EVENT_INTERFACE_PERSO:
|
||||
NameSelect();
|
||||
m_main->ChangePhase(PHASE_APPERANCE);
|
||||
m_main->ChangePhase(PHASE_APPEARANCE);
|
||||
break;
|
||||
|
||||
case EVENT_INTERFACE_NDELETE:
|
||||
|
|
Loading…
Reference in New Issue