DEADSOFTWARE

cosmetix
[d2df-sdl.git] / src / game / g_holmes_ui.inc
index 5175e95155a8663bf3a450283ff8015500202c48..029b28062f7c1bd94daf27691224f354af275c40 100644 (file)
@@ -176,8 +176,14 @@ end;
 procedure uiDraw ();
 var
   f: Integer;
+  ctl: THControl;
 begin
-  for f := 0 to High(uiTopList) do uiTopList[f].draw();
+  for f := 0 to High(uiTopList) do
+  begin
+    ctl := uiTopList[f];
+    ctl.draw();
+    if (f <> High(uiTopList)) then darkenRect(ctl.x0, ctl.y0, ctl.width, ctl.height, 128);
+  end;
 end;
 
 
@@ -740,6 +746,7 @@ procedure THTopWindow.drawControlPost (sx, sy: Integer);
 var
   r, g, b: Integer;
 begin
+  {
   if getFocused then
   begin
     r := 255;
@@ -752,6 +759,10 @@ begin
     g := 127;
     b := 127;
   end;
+  }
+  r := 255;
+  g := 255;
+  b := 255;
   drawRect(mX, mY, mWidth, mHeight, r, g, b);
   if (Length(mTitle) > 0) then
   begin
@@ -834,6 +845,7 @@ begin
   SetLength(mChecks, Length(mChecks)+1);
   mChecks[High(mChecks)] := bv;
   if (Length(mItems)*8+4 > mHeight) then mHeight := Length(mItems)*8+4;
+  if (mCurIndex < 0) then mCurIndex := 0;
 end;
 
 
@@ -847,9 +859,12 @@ begin
   for f := 0 to High(mItems) do
   begin
     if (mCurIndex = f) then fillRect(sx-2, sy, mWidth, 8, 0, 128, 0);
-    drawText8(sx, sy, '[ ]', 255, 255, 255);
-    if (mChecks[f] <> nil) and (mChecks[f]^) then drawText8(sx+6, sy, 'x', 255, 255, 255);
-    drawText8(sx+3*8+2, sy, mItems[f], 255, 255, 0);
+    if (mChecks[f] <> nil) then
+    begin
+      drawText8(sx, sy, '[ ]', 255, 255, 255);
+      if mChecks[f]^ then drawText8(sx+6, sy, 'x', 255, 255, 255);
+      drawText8(sx+3*8+2, sy, mItems[f], 255, 255, 0);
+    end;
     Inc(sy, 8);
   end;
 end;
@@ -869,8 +884,11 @@ begin
       if (ly < 2) then ly := 2;
       ly := ly div 8;
       if (ly < 0) then ly := 0 else if (ly > High(mItems)) then ly := High(mItems);
-      mCurIndex := ly;
-      if (mChecks[ly] <> nil) then mChecks[ly]^ := not mChecks[ly]^;
+      if (mChecks[ly] <> nil) then
+      begin
+        mCurIndex := ly;
+        if (mChecks[ly] <> nil) then mChecks[ly]^ := not mChecks[ly]^;
+      end;
     end;
   end;
 end;