forked from JernejL/samp-map-editor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathu_carcolors.pas
47 lines (36 loc) · 1.11 KB
/
u_carcolors.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
unit u_carcolors;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, StdCtrls, Buttons, ExtCtrls;
type
Twnd_carcolorpicker = class(TForm)
DrawGrid1: TDrawGrid;
CheckBox1: TCheckBox;
DrawGrid2: TDrawGrid;
CheckBox2: TCheckBox;
procedure DrawGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure DrawGrid1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
wnd_carcolorpicker: Twnd_carcolorpicker;
implementation
uses u_edit;
{$R *.dfm}
procedure Twnd_carcolorpicker.DrawGrid1DrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
if u_edit.city = nil then exit;
(sender as TDrawGrid).canvas.Brush.color:= city.colors.colors[arow * 16 + acol];
(sender as TDrawGrid).Canvas.FillRect(rect);
end;
procedure Twnd_carcolorpicker.DrawGrid1Click(Sender: TObject);
begin
u_edit.gtaeditor.inp_coordseditchange(u_edit.gtaeditor.inp_coordsedit);
end;
end.