[colobot] 30/145: Appearance customization face butons fix

Didier Raboud odyx at moszumanska.debian.org
Mon Jul 11 12:56:14 UTC 2016


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch debian/master
in repository colobot.

commit 831276f37892fba73865be4e668d9dae68e1b3f2
Author: Smok94 <tor94 at o2.pl>
Date:   Sat Apr 2 13:13:42 2016 +0200

    Appearance customization face butons fix
    
    *face buttons 2 and 4 swaped.
    *default hair colors now fit to buttons look
    *changing face changes hair color do default
    
    Fixes two first issues mentioned in the #724
---
 src/common/restext.cpp             |  4 +--
 src/level/player_profile.cpp       | 55 +++++++++++++++++++++++++++++---------
 src/level/player_profile.h         |  1 +
 src/ui/screen/screen_apperance.cpp |  5 ++--
 4 files changed, 49 insertions(+), 16 deletions(-)

diff --git a/src/common/restext.cpp b/src/common/restext.cpp
index c1cd857..1ef4930 100644
--- a/src/common/restext.cpp
+++ b/src/common/restext.cpp
@@ -283,9 +283,9 @@ void InitializeRestext()
     stringsEvent[EVENT_INTERFACE_PCGb]      = TR("Green");
     stringsEvent[EVENT_INTERFACE_PCBb]      = TR("Blue");
     stringsEvent[EVENT_INTERFACE_PFACE1]    = TR("\\Face 1");
-    stringsEvent[EVENT_INTERFACE_PFACE2]    = TR("\\Face 4");
+    stringsEvent[EVENT_INTERFACE_PFACE2]    = TR("\\Face 2");
     stringsEvent[EVENT_INTERFACE_PFACE3]    = TR("\\Face 3");
-    stringsEvent[EVENT_INTERFACE_PFACE4]    = TR("\\Face 2");
+    stringsEvent[EVENT_INTERFACE_PFACE4]    = TR("\\Face 4");
     stringsEvent[EVENT_INTERFACE_PGLASS0]   = TR("\\No eyeglasses");
     stringsEvent[EVENT_INTERFACE_PGLASS1]   = TR("\\Eyeglasses 1");
     stringsEvent[EVENT_INTERFACE_PGLASS2]   = TR("\\Eyeglasses 2");
diff --git a/src/level/player_profile.cpp b/src/level/player_profile.cpp
index a34bfb5..7eba33c 100644
--- a/src/level/player_profile.cpp
+++ b/src/level/player_profile.cpp
@@ -38,9 +38,9 @@ void PlayerApperance::DefPerso()
     this->colorCombi.r = 206.0f/256.0f;
     this->colorCombi.g = 206.0f/256.0f;
     this->colorCombi.b = 204.0f/256.0f;  // ~white
-    this->colorBand.r  = 255.0f/256.0f;
-    this->colorBand.g  = 132.0f/256.0f;
-    this->colorBand.b  =   1.0f/256.0f;  // orange
+    this->colorBand.r = 255.0f / 256.0f;
+    this->colorBand.g = 132.0f / 256.0f;
+    this->colorBand.b = 1.0f / 256.0f;  // orange
 
     if ( this->face == 0 )  // normal ?
     {
@@ -52,23 +52,23 @@ void PlayerApperance::DefPerso()
     if ( this->face == 1 )  // bald ?
     {
         this->glasses = 0;
-        this->colorHair.r =  83.0f/256.0f;
-        this->colorHair.g =  64.0f/256.0f;
-        this->colorHair.b =  51.0f/256.0f;  // brown
+        this->colorHair.r = 74.0f / 256.0f;
+        this->colorHair.g = 58.0f / 256.0f;
+        this->colorHair.b = 46.0f / 256.0f;  // brown
     }
     if ( this->face == 2 )  // carlos ?
     {
         this->glasses = 1;
-        this->colorHair.r =  85.0f/256.0f;
-        this->colorHair.g =  48.0f/256.0f;
+        this->colorHair.r = 70.0f / 256.0f;
+        this->colorHair.g = 40.0f / 256.0f;
         this->colorHair.b =   9.0f/256.0f;  // brown
     }
-    if ( this->face == 3 )  // blond ?
+    if ( this->face == 3 )  // blond ? -> ginger ?
     {
         this->glasses = 4;
-        this->colorHair.r = 255.0f/256.0f;
-        this->colorHair.g = 255.0f/256.0f;
-        this->colorHair.b = 181.0f/256.0f;  // yellow
+        this->colorHair.r = 74.0f / 256.0f;
+        this->colorHair.g = 16.0f / 256.0f;
+        this->colorHair.b = 0.0f / 256.0f;  // yellow, changed to ginger
     }
 
     this->colorHair.a  = 0.0f;
@@ -76,6 +76,37 @@ void PlayerApperance::DefPerso()
     this->colorBand.a  = 0.0f;
 }
 
+void PlayerApperance::DefHairColor()
+    {
+    if (this->face == 0)  // normal ?
+        {
+        this->colorHair.r = 90.0f / 256.0f;
+        this->colorHair.g = 95.0f / 256.0f;
+        this->colorHair.b = 85.0f / 256.0f;  // black
+        }
+    if (this->face == 1)  // bald ?
+         {
+        this->colorHair.r = 74.0f / 256.0f;
+        this->colorHair.g = 58.0f / 256.0f;
+        this->colorHair.b = 46.0f / 256.0f;  // brown
+        }
+    if (this->face == 2)  // carlos ?
+         {
+        this->colorHair.r = 70.0f / 256.0f;
+        this->colorHair.g = 40.0f / 256.0f;
+        this->colorHair.b = 9.0f / 256.0f;  // brown
+        }
+    if (this->face == 3)  // blond ? -> ginger ?
+         {
+        this->colorHair.r = 74.0f / 256.0f;
+        this->colorHair.g = 16.0f / 256.0f;
+        this->colorHair.b = 0.0f / 256.0f;  // yellow, changed to ginger
+        }
+    
+        this->colorHair.a = 0.0f;
+    }
+
+
 CPlayerProfile::CPlayerProfile(std::string playerName)
 {
     m_playerName = playerName;
diff --git a/src/level/player_profile.h b/src/level/player_profile.h
index 63bbfd7..fc198cb 100644
--- a/src/level/player_profile.h
+++ b/src/level/player_profile.h
@@ -42,6 +42,7 @@ struct PlayerApperance
     Gfx::Color   colorBand;      // strips color
 
     void DefPerso();
+    void DefHairColor();
 };
 
 struct SavedScene
diff --git a/src/ui/screen/screen_apperance.cpp b/src/ui/screen/screen_apperance.cpp
index 82c9226..9ae82c9 100644
--- a/src/ui/screen/screen_apperance.cpp
+++ b/src/ui/screen/screen_apperance.cpp
@@ -164,13 +164,13 @@ void CScreenApperance::CreateInterface()
     pb = pw->CreateButton(pos, ddim, 43, EVENT_INTERFACE_PFACE1);
     pb->SetState(STATE_SHADOW);
     pos.x += 50.0f/640.0f;
-    pb = pw->CreateButton(pos, ddim, 46, EVENT_INTERFACE_PFACE4);
+    pb = pw->CreateButton(pos, ddim, 44, EVENT_INTERFACE_PFACE2);
     pb->SetState(STATE_SHADOW);
     pos.x += 50.0f/640.0f;
     pb = pw->CreateButton(pos, ddim, 45, EVENT_INTERFACE_PFACE3);
     pb->SetState(STATE_SHADOW);
     pos.x += 50.0f/640.0f;
-    pb = pw->CreateButton(pos, ddim, 44, EVENT_INTERFACE_PFACE2);
+    pb = pw->CreateButton(pos, ddim, 46, EVENT_INTERFACE_PFACE4);
     pb->SetState(STATE_SHADOW);
 
     // Glasses
@@ -349,6 +349,7 @@ bool CScreenApperance::EventProcess(const Event &event)
         case EVENT_INTERFACE_PFACE3:
         case EVENT_INTERFACE_PFACE4:
             apperance.face = event.type-EVENT_INTERFACE_PFACE1;
+            apperance.DefHairColor();
             UpdatePerso();
             m_main->ScenePerso();
             break;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list