- Many small fixes in engine
authorunc0rr
Thu, 17 Aug 2006 13:54:18 +0000
changeset 113 d975a426ebf7
parent 112 ca5f06017e99
child 114 2762edfc23a9
- Many small fixes in engine - Better widget placement and translation update in frontend
QTfrontend/pages.cpp
QTfrontend/translations/hedgewars_ru.qm
QTfrontend/translations/hedgewars_ru.ts
hedgewars/GSHandlers.inc
hedgewars/HHHandlers.inc
hedgewars/uGame.pas
--- a/QTfrontend/pages.cpp	Wed Aug 16 21:35:27 2006 +0000
+++ b/QTfrontend/pages.cpp	Thu Aug 17 13:54:18 2006 +0000
@@ -355,7 +355,9 @@
 	NNGroupBox = new QGroupBox(this);
 	NNGroupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
 	NNGroupBox->setTitle(QGroupBox::tr("Net options"));
-	pageLayout->addWidget(NNGroupBox, 1, 1);
+	pageLayout->addWidget(NNGroupBox, 0, 1);
+
+	pageLayout->addWidget(new QWidget(), 1, 1);
 
 	QGridLayout * GBNlayout = new QGridLayout(NNGroupBox);
 	labelNN = new QLabel(NNGroupBox);
Binary file QTfrontend/translations/hedgewars_ru.qm has changed
--- a/QTfrontend/translations/hedgewars_ru.ts	Wed Aug 16 21:35:27 2006 +0000
+++ b/QTfrontend/translations/hedgewars_ru.ts	Thu Aug 17 13:54:18 2006 +0000
@@ -7,7 +7,7 @@
     </message>
     <message>
         <source>Cannot create directory %1</source>
-        <translation>Не могу создать папку %1</translation>
+        <translation type="obsolete">Не могу создать папку %1</translation>
     </message>
     <message>
         <source>Quit</source>
@@ -59,6 +59,10 @@
         <source>Cannot open demofile %1</source>
         <translation>Не могу открыть демо %1</translation>
     </message>
+    <message>
+        <source>Unable to run engine: %1 (</source>
+        <translation>Ошибка запуска движка: %1 (</translation>
+    </message>
 </context>
 <context>
     <name>HWNet</name>
@@ -118,7 +122,11 @@
     </message>
     <message>
         <source>Net nick</source>
-        <translation>Имя игрока</translation>
+        <translation type="obsolete">Имя игрока</translation>
+    </message>
+    <message>
+        <source>Net options</source>
+        <translation>Настройки сети</translation>
     </message>
 </context>
 <context>
@@ -127,6 +135,10 @@
         <source>Net nick</source>
         <translation>Имя игрока</translation>
     </message>
+    <message>
+        <source>Server address</source>
+        <translation>Адрес сервера</translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -143,6 +155,21 @@
     </message>
 </context>
 <context>
+    <name>QObject</name>
+    <message>
+        <source>Error</source>
+        <translation>Ошибка</translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation>Не могу создать папку %1</translation>
+    </message>
+    <message>
+        <source>Quit</source>
+        <translation>Выйти</translation>
+    </message>
+</context>
+<context>
     <name>QPushButton</name>
     <message>
         <source>Single Player</source>
--- a/hedgewars/GSHandlers.inc	Wed Aug 16 21:35:27 2006 +0000
+++ b/hedgewars/GSHandlers.inc	Thu Aug 17 13:54:18 2006 +0000
@@ -348,7 +348,10 @@
    gtATFinishGame: begin
                    AllInactive:= false;
                    if Gear.Timer = 0 then
+                      begin
+                      SendIPC('N');
                       GameState:= gsExit
+                      end
                    end;
      end;
 if Gear.Timer = 0 then DeleteGear(Gear)
@@ -439,8 +442,8 @@
            State:= State or gstFalling;
            end;
       DeleteGear(Gear);
-      OnUsedAmmo(PHedgehog(Gear.Hedgehog)^.Ammo);
-      ApplyAmmoChanges(PHedgehog(Gear.Hedgehog)^)
+      OnUsedAmmo(PHedgehog(HHGear.Hedgehog)^.Ammo);
+      ApplyAmmoChanges(PHedgehog(HHGear.Hedgehog)^)
     end;
 
 begin
@@ -551,8 +554,8 @@
 var HHGear: PGear;
     tx, ty, tt: Double;
 begin
-Gear.X:= Gear.X + Gear.dX;
-Gear.Y:= Gear.Y + Gear.dY;
+Gear.X:= Gear.X - Gear.dX;
+Gear.Y:= Gear.Y - Gear.dY;
 Gear.Elasticity:= Gear.Elasticity + 1.0;
 HHGear:= PHedgehog(Gear.Hedgehog)^.Gear;
 if (HHGear.State and gstFalling) <> 0 then
@@ -584,8 +587,8 @@
                 with HHGear^ do State:= State and not gstAttacking;
                 tt:= 0
                 end;
-            tx:= tx - Gear.dX - Gear.dX;
-            ty:= ty - Gear.dY - Gear.dY;
+            tx:= tx + Gear.dX - Gear.dX;
+            ty:= ty + Gear.dY - Gear.dY;
             tt:= tt - 2.0;
             end;
       end;
@@ -611,6 +614,8 @@
 
 procedure doStepRope(Gear: PGear);
 begin
+Gear.dX:= - Gear.dX;
+Gear.dY:= - Gear.dY;
 Gear.doStep:= doStepRopeAttach
 end;
 
--- a/hedgewars/HHHandlers.inc	Wed Aug 16 21:35:27 2006 +0000
+++ b/hedgewars/HHHandlers.inc	Thu Aug 17 13:54:18 2006 +0000
@@ -321,7 +321,7 @@
             if not TestCollisionXwithXYShift(Gear, hwSign(Gear.dX) - Gear.dX, -3, hwSign(Gear.dX)) then begin Gear.X:= Gear.X + Gear.dX; Gear.dX:= Gear.dX * 0.90; Gear.Y:= Gear.Y - 3 end else
             if not TestCollisionXwithXYShift(Gear, hwSign(Gear.dX) - Gear.dX, -4, hwSign(Gear.dX)) then begin Gear.X:= Gear.X + Gear.dX; Gear.dX:= Gear.dX * 0.87; Gear.Y:= Gear.Y - 4 end else
             if not TestCollisionXwithXYShift(Gear, hwSign(Gear.dX) - Gear.dX, -5, hwSign(Gear.dX)) then begin Gear.X:= Gear.X + Gear.dX; Gear.dX:= Gear.dX * 0.84; Gear.Y:= Gear.Y - 5 end else
-            if abs(Gear.dX) > 0.02 then Gear.dX:= -0.5 * Gear.dX
+            if abs(Gear.dX) > 0.02 then Gear.dX:= -0.2 * Gear.dX
                                    else begin
                                         Gear.State:= Gear.State and not gstMoving;
                                         Gear.dX:= 0.0000001 * hwSign(Gear.dX)
--- a/hedgewars/uGame.pas	Wed Aug 16 21:35:27 2006 +0000
+++ b/hedgewars/uGame.pas	Thu Aug 17 13:54:18 2006 +0000
@@ -54,13 +54,14 @@
    end
    else begin
    ProcessKbd;
-   NetGetNextCmd; // its for the case when receiving /say message
+   NetGetNextCmd; // its for the case when receiving "/say" message
+   isInLag:= false;
+   inc(SendEmptyPacketTicks, Lag);
    if SendEmptyPacketTicks >= cSendEmptyPacketTime then
       begin
-      SendIPC('+');
+      SendIPC('N');
       SendEmptyPacketTicks:= 0
-      end;
-   inc(SendEmptyPacketTicks, Lag)
+      end
    end;
 
 if Lag > 100 then Lag:= 100
@@ -79,7 +80,7 @@
        NetGetNextCmd;
        if isInLag then
           case GameType of
-               gmtNet: break;
+                gmtNet: break;
                gmtDemo: begin
                         GameState:= gsExit;
                         exit
@@ -94,7 +95,6 @@
        end;
     inc(i)
     end;
-if not CurrentTeam.ExtDriven then isInLag:= false;
 
 MoveCamera
 end;