[done] New icons for boost always and damage normal

[done] New icons for boost always and damage normal

Postby Wuzzy » 07 Apr 2014, 20:06

Okay, I have made small changes to the code and images to tweak a little bit the symbols in certain boost and damage modes.

When damage is off, there is no in-game icon at all. This is the old behaviour.
When damage is reduced, there is a hammer icon. This is the old icon.
When damage is normal, there is a hammer with wrench icon. This is new and based on an image in the public domain.

When boost mode is “always”, there was no boost icon. But no icon is also shown if boost is deactivated, so this is ambigious.
I changed it so in boost mode “always” there is the boost icon shown plus the symbol for infinity. I created the symbol by myselves.

I used git to manage the changes.
I just have no clue how I could commit this.

In the small screenshot you see these small changes. Here boost mode “always” is on and damage mode is on “normal”.

For some reason, the percentage does not align very well. If you have 100% damage, part of the per cent sign is written over the icon. However, this was also the case before my changes. From what I’ve (quickly) read in the code, the percentage should align to the right but in fact it doesn’t. Strange.
Attachments
infinity.jpg
New icons for boost mode “always” and normal damage mode.
infinity.jpg (8.79 KiB) Viewed 8133 times
User avatar
Wuzzy
 
Posts: 989
Joined: 28 May 2012, 23:13

Re: New icons for boost mode “always” and damage mode “norma

Postby CryHam » 11 Apr 2014, 20:56

Cool idea. I'll add it.
I think for boost always just the boost icon without any digits could do.
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Re: New icons for boost mode “always” and damage mode “norma

Postby Wuzzy » 11 Apr 2014, 21:22

You don’t understand. The work has already been done.
No need to do it twice. ;-)

Here is the new gui_icons.png:
http://i.imgur.com/qWh0iuc.png
(alternative link: http://rghost.net/54007043/image.png)

Here’s a diff of the source files (output from git):
{l Code}: {l Select All Code}
diff --git a/source/ogre/CHud.h b/source/ogre/CHud.h
index 18a34eb..2dfad3d 100644
--- a/source/ogre/CHud.h
+++ b/source/ogre/CHud.h
@@ -70,7 +70,7 @@ public:
 
       //  boost fuel, damage %, rewind time
       MyGUI::TextBox  *txBFuel, *txDamage, *txRewind;
-      MyGUI::ImageBox *icoBFuel,*icoDamage,*icoRewind;
+      MyGUI::ImageBox *icoBFuel,*icoBInf,*icoDamage,*icoRewind;
       
       //  current camera name
       MyGUI::TextBox *txCam;
diff --git a/source/ogre/Hud_Create.cpp b/source/ogre/Hud_Create.cpp
index 9ef7fbe..bfbb15e 100644
--- a/source/ogre/Hud_Create.cpp
+++ b/source/ogre/Hud_Create.cpp
@@ -104,6 +104,7 @@ void CHud::Size()
          }
          h.txBFuel ->setPosition(gxL-83,   gy-60);
          h.icoBFuel->setPosition(gxL-83+54,gy-60-5+2);
+         h.icoBInf ->setPosition(gxL-83+14,gy-60-5+2);
          #else
          if (h.txDamage)
          {   h.txDamage ->setPosition(bx-70,   by-70);
@@ -280,6 +281,11 @@ void CHud::Create()
       //h.txVel->setTextShadow(true);
       
       //  boost
+      h.icoBInf = h.parent->createWidget<ImageBox>("ImageBox",
+         0,y, 40,40, Align::Right, "IInf"+s);
+      h.icoBInf->setImageTexture("gui_icons.png");
+      h.icoBInf->setImageCoord(IntCoord(512,768,128,128));
+
       h.txBFuel = h.parent->createWidget<TextBox>("TextBox",
          0,y, 240,80, Align::Right, "Fuel"+s);  h.txBFuel->setVisible(false);
       h.txBFuel->setFontName("DigGear");  h.txBFuel->setFontHeight(72);
@@ -301,7 +307,10 @@ void CHud::Create()
          h.icoDamage = h.parent->createWidget<ImageBox>("ImageBox",
             0,y, 40,40, Align::Left, "IDmg"+s);  //h.icoDamage->setVisible(false);
          h.icoDamage->setImageTexture("gui_icons.png");
-         h.icoDamage->setImageCoord(IntCoord(512,256,128,128));
+         if (pSet->game.damage_type == 1)
+         { h.icoDamage->setImageCoord(IntCoord(512,256,128,128)); }
+         else
+         { h.icoDamage->setImageCoord(IntCoord(640,384,128,128)); }
       }
       
       //  rewind <<
@@ -536,7 +545,7 @@ CHud::Hud::Hud()
    ,txAbs(0), txTcs(0),  txCam(0)
 
    ,txBFuel(0), txDamage(0), txRewind(0)
-   ,icoBFuel(0), icoDamage(0), icoRewind(0)
+   ,icoBFuel(0), icoBInf(0), icoDamage(0), icoRewind(0)
 
    ,moMap(0), ndMap(0)
 {
@@ -567,6 +576,7 @@ void CHud::Destroy()
       
       Dest(h.txBFuel)  Dest(h.txDamage)  Dest(h.txRewind)
       Dest(h.icoBFuel)  Dest(h.icoDamage)  Dest(h.icoRewind)
+      Dest(h.icoBInf)
 
       for (i=0; i < 3; ++i)  Dest(h.txOpp[i])
       Dest(h.bckOpp)
@@ -623,7 +633,9 @@ void CHud::Show(bool hideAll)
    {
       bool cam = pSet->show_cam && !app->isFocGui, times = pSet->show_times;
       bool opp = pSet->show_opponents && (!app->scn->sc->ter || app->scn->road && app->scn->road->getNumPoints() > 0);
-      bool bfuel = pSet->game.boost_type == 1 || pSet->game.boost_type == 2;
+      bool bfuel = pSet->game.boost_type == 1 || pSet->game.boost_type == 2 || pSet->game.boost_type == 3;
+      bool btxt = pSet->game.boost_type == 1 || pSet->game.boost_type == 2;
+      bool binf = pSet->game.boost_type == 3;
       bool bdmg = pSet->game.damage_type > 0;
       //txCamInfo->setVisible(cam);
 
@@ -635,7 +647,8 @@ void CHud::Show(bool hideAll)
          
             h.txGear->setVisible(pSet->show_digits);
             h.txVel->setVisible(pSet->show_digits);
-            h.txBFuel->setVisible(show && bfuel);  h.icoBFuel->setVisible(show && bfuel);
+            h.txBFuel->setVisible(show && btxt);
+            h.icoBFuel->setVisible(show && bfuel); h.icoBInf->setVisible(show && binf);
             if (h.txDamage)
             {   h.txDamage->setVisible(show && bdmg);  h.icoDamage->setVisible(show && bdmg);   }
             //txRewind;icoRewind;


I started working from commit 5fb442254b0c7e59db3cc38df3f9ac81c3fca234 on.
User avatar
Wuzzy
 
Posts: 989
Joined: 28 May 2012, 23:13

Re: New icons for boost always and damage normal

Postby CryHam » 05 May 2014, 16:01

Woah that's a surprise. Didn't know you program too.
Sorry for the month delay, I had to reinstall my OS.
Anyway, I didn't like the infinity, too bright and redundant for me, for boost always I just left flame symbol without digits.
About commit and push, it's easy if you have a fork, see wiki Contributing.
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Who is online

Users browsing this forum: No registered users and 1 guest

cron