diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas
index 34436a6458ed56d0239f25fb459586e591e1c41d..ba095b7a79f616613e233d541124cb00c817afd6 100644 (file)
--- a/src/game/g_gui.pas
+++ b/src/game/g_gui.pas
wParam: LongInt;
lParam: LongInt;
end;
-
+
TFontType = (FONT_TEXTURE, FONT_CHAR);
TFont = class(TObject)
constructor Create;
procedure OnMessage(var Msg: TMessage); virtual;
procedure Update; virtual;
- procedure Draw; virtual;
+ procedure Draw; virtual;
property X: Integer read FX write FX;
property Y: Integer read FY write FY;
property Enabled: Boolean read FEnabled write FEnabled;
procedure TFont.Draw(X, Y: Integer; Text: string; R, G, B: Byte);
begin
if FFontType = FONT_CHAR then e_CharFont_PrintEx(ID, X, Y, Text, _RGB(R, G, B), FScale)
- else e_TextureFontPrintEx(X, Y, Text, ID, R, G, B, FScale);
+ else e_TextureFontPrintEx(X, Y, Text, ID, R, G, B, FScale);
end;
procedure TFont.GetTextSize(Text: string; var w, h: Word);
FCounter := MAINMENU_MARKERDELAY;
g_Texture_Get(MAINMENU_MARKER1, FMarkerID1);
- g_Texture_Get(MAINMENU_MARKER2, FMarkerID2);
+ g_Texture_Get(MAINMENU_MARKER2, FMarkerID2);
FHeader := TGUILabel.Create(Header, FFontID);
with FHeader do
if FButtons[a] <> nil then FButtons[a].Draw;
if FIndex <> -1 then
- e_Draw(FMarkerID1, FButtons[FIndex].FX-48, FButtons[FIndex].FY, 0, True, False);
+ e_Draw(FMarkerID1, FButtons[FIndex].FX-48, FButtons[FIndex].FY, 0, True, False);
end;
end;
begin
inherited Create();
- FFont := TFont.Create(FontID, FONT_CHAR);
+ FFont := TFont.Create(FontID, FONT_CHAR);
FText := Text;
FFixedLen := 0;
if FFixedLen = 0 then
FFont.GetTextSize(FText, w, h)
else
- w := e_CharFont_GetMaxWidth(FFont.ID)*FFixedLen;
- Result := w;
+ w := e_CharFont_GetMaxWidth(FFont.ID)*FFixedLen;
+ Result := w;
end;
procedure TGUILabel.OnMessage(var Msg: TMessage);
y := FItems[FIndex].Control.FY;
end;
- x := x-e_CharFont_GetMaxWidth(FFontID);
+ x := x-e_CharFont_GetMaxWidth(FFontID);
- e_CharFont_PrintEx(FFontID, x, y, #16, _RGB(255, 0, 0));
+ e_CharFont_PrintEx(FFontID, x, y, #16, _RGB(255, 0, 0));
end;
end;
w, h: Word;
begin
Result := 0;
-
+
for a := 0 to 255 do
begin
FFont.GetTextSize(e_KeyNames[a], w, h);
begin
FKey := IK_ENTER; // <Enter>
FIsQuery := False;
-
+
with FWindow do
if FDefControl <> '' then
SetActive(GetControl(FDefControl))
else
SetActive(nil);
- end;
+ end;
end;
end;
DrawBox(FX, FY, 4, 4);
- if FModel <> nil then FModel.Draw(FX+4, FY+4);
+ if FModel <> nil then FModel.Draw(FX+4, FY+4);
end;
procedure TGUIModelView.NextAnim();
procedure TGUIModelView.SetColor(Red, Green, Blue: Byte);
begin
- if FModel <> nil then FModel.SetColor(Red, Green, Blue);
+ if FModel <> nil then FModel.SetColor(Red, Green, Blue);
end;
procedure TGUIModelView.SetModel(ModelName: string);
a := not a;
if a then Exit;
-
+
if FModel <> nil then FModel.Update;
end;
e_DrawFillQuad(FX+4, FY+4,
FX+4 + Trunc(FMapSize.X / FScale) - 1,
FY+4 + Trunc(FMapSize.Y / FScale) - 1,
- 32, 32, 32, 0);
+ 32, 32, 32, 0);
if FMapData <> nil then
for a := 0 to High(FMapData) do
if X2 < 0 then Continue;
if Y2 < 0 then Continue;
-
+
if X2 > MAPPREVIEW_WIDTH*16 then X2 := MAPPREVIEW_WIDTH*16;
if Y2 > MAPPREVIEW_HEIGHT*16 then Y2 := MAPPREVIEW_HEIGHT*16;
function TGUIListBox.GetHeight: Word;
begin
- Result := 8+FHeight*16;
+ Result := 8+FHeight*16;
end;
function TGUIListBox.GetWidth: Word;
begin
- Result := 8+(FWidth+1)*16;
+ Result := 8+(FWidth+1)*16;
end;
procedure TGUIListBox.OnMessage(var Msg: TMessage);
begin
if FItems <> nil then
FItems := nil;
-
+
FItems := Items;
FStartLine := 0;
begin
if (FIndex = -1) or (FItems = nil) or
(FIndex > High(FItems)) or
- (FItems[FIndex][1] = '/') or
+ (FItems[FIndex][1] = '/') or
(FItems[FIndex][1] = '\') then
fn := ''
else
inherited;
if FImageRes = '' then
- begin
+ begin
if g_Texture_Get(FDefaultRes, ID) then e_Draw(ID, FX, FY, 0, True, False);
end
else