Engine:
authorsmxx
Sat, 27 Mar 2010 20:51:53 +0000
changeset 3123 b0a02930a1dc
parent 3122 e005359efc59
child 3124 ef5525d9403a
Engine: * Added sounds for Birdy (eggs breaking still missing) * Added random coughs/moans to poisoned hogs * Fixed one frame flickers when using fade in/out * Fixed fade in/out while using zoom Frontend: * Added chat context menu icons Themes: * Updated Underwater's horizon
QTfrontend/chatwidget.cpp
QTfrontend/hedgewars.qrc
QTfrontend/res/addfriend.png
QTfrontend/res/follow.png
QTfrontend/res/ignore.png
QTfrontend/res/info.png
QTfrontend/res/kick.png
QTfrontend/res/remfriend.png
QTfrontend/res/unignore.png
hedgewars/GSHandlers.inc
hedgewars/HHHandlers.inc
hedgewars/uConsts.pas
hedgewars/uGears.pas
hedgewars/uWorld.pas
share/hedgewars/Data/Themes/Underwater/horizont.png
--- a/QTfrontend/chatwidget.cpp	Sat Mar 27 17:45:51 2010 +0000
+++ b/QTfrontend/chatwidget.cpp	Sat Mar 27 20:51:53 2010 +0000
@@ -84,16 +84,22 @@
     mainLayout.addWidget(chatNicks, 0, 1);
 
     acInfo = new QAction(QAction::tr("Info"), chatNicks);
+    acInfo->setIcon(QIcon(":/res/info.png"));
     connect(acInfo, SIGNAL(triggered(bool)), this, SLOT(onInfo()));
     acKick = new QAction(QAction::tr("Kick"), chatNicks);
+    acKick->setIcon(QIcon(":/res/kick.png"));
     connect(acKick, SIGNAL(triggered(bool)), this, SLOT(onKick()));
     acBan = new QAction(QAction::tr("Ban"), chatNicks);
+    acBan->setIcon(QIcon(":/res/ban.png"));
     connect(acBan, SIGNAL(triggered(bool)), this, SLOT(onBan()));
     acFollow = new QAction(QAction::tr("Follow"), chatNicks);
+    acFollow->setIcon(QIcon(":/res/follow.png"));
     connect(acFollow, SIGNAL(triggered(bool)), this, SLOT(onFollow()));
     acIgnore = new QAction(QAction::tr("Ignore"), chatNicks);
+    acIgnore->setIcon(QIcon(":/res/ignore.png"));
     connect(acIgnore, SIGNAL(triggered(bool)), this, SLOT(onIgnore()));
     acFriend = new QAction(QAction::tr("Add friend"), chatNicks);
+    acFriend->setIcon(QIcon(":/res/addfriend.png"));
     connect(acFriend, SIGNAL(triggered(bool)), this, SLOT(onFriend()));
 
     chatNicks->insertAction(0, acInfo);
@@ -341,14 +347,26 @@
 
     // update context menu labels according to possible action
     if(ignoreList.contains(item->text(), Qt::CaseInsensitive))
+    {
         acIgnore->setText(QAction::tr("Unignore"));
+        acIgnore->setIcon(QIcon(":/res/unignore.png"));
+    }
     else
+    {
         acIgnore->setText(QAction::tr("Ignore"));
+        acIgnore->setIcon(QIcon(":/res/ignore.png"));
+    }
 
     if(friendsList.contains(item->text(), Qt::CaseInsensitive))
+    {
         acFriend->setText(QAction::tr("Remove friend"));
+        acFriend->setIcon(QIcon(":/res/remfriend.png"));
+    }
     else
+    {
         acFriend->setText(QAction::tr("Add friend"));
+        acFriend->setIcon(QIcon(":/res/addfriend.png"));
+    }
 }
 
 void HWChatWidget::setShowReady(bool s)
--- a/QTfrontend/hedgewars.qrc	Sat Mar 27 17:45:51 2010 +0000
+++ b/QTfrontend/hedgewars.qrc	Sat Mar 27 20:51:53 2010 +0000
@@ -85,7 +85,14 @@
     <file>res/chat_default_off.png</file>
     <file>res/chat_ignore_off.png</file>
     <file>res/chat_friend_off.png</file>
-	<file>res/ammopicbox.png</file>
-	<file>res/ammopicdelay.png</file>
+    <file>res/ammopicbox.png</file>
+    <file>res/ammopicdelay.png</file>
+    <file>res/addfriend.png</file>
+    <file>res/remfriend.png</file>
+    <file>res/ignore.png</file>
+    <file>res/unignore.png</file>
+    <file>res/follow.png</file>
+    <file>res/info.png</file>
+    <file>res/kick.png</file>
 </qresource>
 </RCC>
Binary file QTfrontend/res/addfriend.png has changed
Binary file QTfrontend/res/follow.png has changed
Binary file QTfrontend/res/ignore.png has changed
Binary file QTfrontend/res/info.png has changed
Binary file QTfrontend/res/kick.png has changed
Binary file QTfrontend/res/remfriend.png has changed
Binary file QTfrontend/res/unignore.png has changed
--- a/hedgewars/GSHandlers.inc	Sat Mar 27 17:45:51 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Sat Mar 27 20:51:53 2010 +0000
@@ -2808,6 +2808,7 @@
         HHGear^.Message := HHGear^.Message and not gm_Attack;
         if Gear^.FlightTime > 0 then begin
             AddGear(hwRound(Gear^.X), hwRound(Gear^.Y) + 32, gtEgg, 0, Gear^.dX * _0_5, Gear^.dY, 0);
+            PlaySound(sndBirdyLay);
             dec(Gear^.FlightTime)
         end;
 end;
--- a/hedgewars/HHHandlers.inc	Sat Mar 27 17:45:51 2010 +0000
+++ b/hedgewars/HHHandlers.inc	Sat Mar 27 20:51:53 2010 +0000
@@ -192,7 +192,10 @@
                         amDrill: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtDrill, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0);
                       amBallgun: CurAmmoGear:= AddGear(hwRound(X), hwRound(Y), gtBallgun,  0, xx * _0_5, yy * _0_5, 0);
                     amJetpack: CurAmmoGear:= AddGear(hwRound(X), hwRound(Y), gtJetpack, 0, _0, _0, 0);
-                    amBirdy: CurAmmoGear:= AddGear(hwRound(X), hwRound(Y) - 120, gtBirdy, 0, _0, _0, 0);
+                    amBirdy: begin
+                             PlaySound(sndWhistle);
+                             CurAmmoGear:= AddGear(hwRound(X), hwRound(Y) - 120, gtBirdy, 0, _0, _0, 0)
+                             end;
                       amLowGravity: begin
                                     PlaySound(sndLowGravity);
                                     cGravity:= cMaxWindSpeed / 2
--- a/hedgewars/uConsts.pas	Sat Mar 27 17:45:51 2010 +0000
+++ b/hedgewars/uConsts.pas	Sat Mar 27 20:51:53 2010 +0000
@@ -114,7 +114,8 @@
             sndNooo, sndHello, sndRopeShot, sndRopeAttach, sndRopeRelease,
             sndSwitchHog, sndVictory, sndSniperReload, sndSteps, sndLowGravity,
             sndHellishImpact1, sndHellishImpact2, sndHellishImpact3, sndHellishImpact4,
-            sndMelonImpact, sndDroplet1, sndDroplet2, sndDroplet3, sndEggBreak, sndDrillRocket);
+            sndMelonImpact, sndDroplet1, sndDroplet2, sndDroplet3, sndEggBreak, sndDrillRocket,
+            sndPoisonCough, sndPoisonMoan, sndBirdyLay, sndWhistle);
 
     TAmmoType  = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer,
             amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip,
@@ -838,7 +839,11 @@
             (FileName:             'Droplet2.ogg'; Path: ptSounds),// sndDroplet2
             (FileName:             'Droplet3.ogg'; Path: ptSounds),// sndDroplet3
             (FileName:                         ''; Path: ptSounds),// sndEggBreak
-            (FileName:             'drillgun.ogg'; Path: ptSounds) // sndDrillRocket
+            (FileName:             'drillgun.ogg'; Path: ptSounds),// sndDrillRocket
+            (FileName:          'PoisonCough.ogg'; Path: ptVoices),// sndPoisonCough
+            (FileName:           'PoisonMoan.ogg'; Path: ptVoices),// sndPoisonMoan
+            (FileName:             'BirdyLay.ogg'; Path: ptSounds),// sndBirdyLay
+            (FileName:              'Whistle.ogg'; Path: ptSounds) // sndWhistle
             );
 
     Ammoz: array [TAmmoType] of record
--- a/hedgewars/uGears.pas	Sat Mar 27 17:45:51 2010 +0000
+++ b/hedgewars/uGears.pas	Sat Mar 27 20:51:53 2010 +0000
@@ -636,6 +636,12 @@
     begin
     Gear:= t;
     t:= Gear^.NextGear;
+    if (((GameTicks + Gear^.UID * 100) mod 1000) = 0) and (Gear^.Kind = gtHedgehog) and (Gear^.Hedgehog <> nil) and (PHedgehog(Gear^.Hedgehog)^.Effects[hePoisoned]) and (getRandom(100) = 0) then
+        if getRandom(2) = 0 then
+            PlaySound(sndPoisonCough, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack)
+        else
+            PlaySound(sndPoisonMoan, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack);
+
     if Gear^.Active then
         begin
         if Gear^.RenderTimer and (Gear^.Timer > 500) and ((Gear^.Timer mod 1000) = 0) then
--- a/hedgewars/uWorld.pas	Sat Mar 27 17:45:51 2010 +0000
+++ b/hedgewars/uWorld.pas	Sat Mar 27 20:51:53 2010 +0000
@@ -802,25 +802,6 @@
 if GameState = gsConfirm then
     DrawCentered(0, (cScreenHeight shr 1), ConfirmTexture);
 
-SetScale(zoom);
-
-// Cursor
-if isCursorVisible then
-   begin
-   if not bShowAmmoMenu then
-     with CurrentHedgehog^ do
-       if (Gear^.State and gstHHChooseTarget) <> 0 then
-         begin
-         i:= Ammo^[CurSlot, CurAmmo].Pos;
-         with Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType] do
-           if PosCount > 1 then
-              DrawSprite(PosSprite, CursorPoint.X - (SpritesData[PosSprite].Width shr 1),
-                                    cScreenHeight - CursorPoint.Y - (SpritesData[PosSprite].Height shr 1),
-                                    i);
-         end;
-   DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8)
-   end;
-
 glDisable(GL_TEXTURE_2D);
 
 if ScreenFade <> sfNone then
@@ -830,11 +811,11 @@
             sfToBlack, sfToWhite:     if ScreenFadeValue + Lag * ScreenFadeSpeed < sfMax then
                                           inc(ScreenFadeValue, Lag * ScreenFadeSpeed)
                                       else
-                                          ScreenFade:= sfNone;
+                                          ScreenFadeValue:= sfMax;
             sfFromBlack, sfFromWhite: if ScreenFadeValue - Lag * ScreenFadeSpeed > 0 then
                                           dec(ScreenFadeValue, Lag * ScreenFadeSpeed)
                                       else
-                                          ScreenFade:= sfNone;
+                                          ScreenFadeValue:= 0;
             end;
     if ScreenFade <> sfNone then
         begin
@@ -858,10 +839,32 @@
         glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer));
         glDisableClientState(GL_VERTEX_ARRAY);
          
-        glColor4f(1, 1, 1, 1)
+        glColor4f(1, 1, 1, 1);
+        if not isFirstFrame and ((ScreenFadeValue = 0) or (ScreenFadeValue = sfMax)) then ScreenFade:= sfNone
         end
     end;
 
+SetScale(zoom);
+glEnable(GL_TEXTURE_2D);
+
+// Cursor
+if isCursorVisible then
+   begin
+   if not bShowAmmoMenu then
+     with CurrentHedgehog^ do
+       if (Gear^.State and gstHHChooseTarget) <> 0 then
+         begin
+         i:= Ammo^[CurSlot, CurAmmo].Pos;
+         with Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType] do
+           if PosCount > 1 then
+              DrawSprite(PosSprite, CursorPoint.X - (SpritesData[PosSprite].Width shr 1),
+                                    cScreenHeight - CursorPoint.Y - (SpritesData[PosSprite].Height shr 1),
+                                    i);
+         end;
+   DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8)
+   end;
+
+glDisable(GL_TEXTURE_2D);
 glDisable(GL_BLEND);
 isFirstFrame:= false
 end;
Binary file share/hedgewars/Data/Themes/Underwater/horizont.png has changed