Jump to content
Korean Random
Sign in to follow this  
Andrew_Dark

Помогите с инсталлятором модов для мир танков.

Recommended Posts

Здравствуйте, уважаемые пользователи форума, долго мучаясь, пришёл к выводу, что сделать инсталлятор для модов у меня не получается, поэтому прошу оказать помощь вас... Моды у меня разпиханы по папкам, друг с другом не конфликтуют при установке "сверху", но есть некоторые "но", которые должны быть соблюдены:

1) В инсталляторе должен быть список выбора модов типа 1, 1.1, 1.2, 2, 2.1 и тд.

2) Добавлены готовые картинки лого (есть в наличии). (картинки к самим модам могу запилить, если нужно и сможете запихнуть в модпак).

3) Готовый модпак не должен занимать много места (не более 1ГБ). Исходные файлы модов имеют размер до 1.2 ГБ. (если настроите копирование озвучки с папки res, с добавлением файлов озвучки екипажа и "лампочки"  "сверху", то размер будет наполовину меньше).

4) Модпак должен удалять по запросу пользователя все моды с папки с модами (или оставлять всё как есть).

В модпаке будет указан ваш ник или имя (по вашему желанию) как создателя модпака, список модов и сами моды, в разделе faq.

Данную помощь прошу сделать бесплатно, так как ясейчас пока студент:) и немного на мели:) Но со своей стороны могу помочь вам и вашим знакомым в: настройке и ускорении работы ПК (результат гарантирую), удалении вирусов при невозможности удаления вашим антивирусом (у вас должно быть подключение к интернету), исправлении некоректной работы драйверов, их настройка внутри системы, и тд. Кто может помочь, пишите тут или в скайп kozyrniy2. 

  • Downvote 1

Share this post


Link to post

Short link
Share on other sites

Знаю, пробовал сделать, у меня не выходит, поэтому и прошу помощи:(


Я не знаю как сделать, чтобы правильно его скомпилировать:)

Share this post


Link to post

Short link
Share on other sites

помочь нет желания?

Вам уже помогли - дали тему с кучей примеров, вики с основами.

За вас никто ничего делать не будет.

"Если хочешь помочь голодному - дай ему семян, а не хлеб"

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

 

 

дали тему с кучей примеров, вики с основами.
За это спасибо конечно, уже замутил модпак, но пока только однофайловый, будем пробовать, просто не понимаю такую штуку, допустим я создал 3 папки из 3 разных модов, прописал откуда их брать в основной скрипт, но как сделать что был выбор этих компонентов при установке я никак не пойму. 

Share this post


Link to post

Short link
Share on other sites

скачал пример там есть кампонент лист вот и прописывай их там

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

Так, всем кто советовал тему с инструкциями выше, после 7 раза немного дошло, единственное что осталось выяснить, это как прописать фон для инсталлятора в самом скрипте, чтобы заменить фон на странице с списком модов. и ещё что я тут в коде напартачил? стараюсь прицепить фон кнопок.

вот кусок кода:

'Развернуть'

procedure RedesignWizardForm;

begin
with WizardForm do
begin
AutoScroll := False;
end;
end;

const
UNDEF_INDEX = -777;

function GetCursorPos(var lpPoint: TPoint): BOOL; external '[email protected] stdcall';

var
InfoPic: TBitmapImage;
LastIndex: Integer;
TempPath: String;

procedure ShowPicHint(const PicFilePath: String);
var
pt: TPoint;
begin
if not GetCursorPos(pt) then Exit;
InfoPic.Bitmap.LoadFromFile(PicFilePath);
InfoPic.SetBounds(ScaleX(1), ScaleY(41), ScaleX(250), ScaleY(200)); // êàðòèíêà
InfoPic.Show;
end;

procedure CompOnItemMouseMove(Sender: TObject; X, Y: Integer; Index: Integer; Area: TItemArea);
var
UndefPic: String;
begin
if Index = -1 then Exit;
if Index = LastIndex then Exit;
try
case TNewCheckListBox(Sender).ItemCaption[index] of
//-----------------------ÊÀÐÒÈÍÊÈ----------------------------\\
'1. Êîìïëåêñíûé ìîä XVM v2.1': UndefPic := '1.bmp'; // ïèøåì òî÷íî òàê æå, êàê ïðîïèñàíî â êîìïîíåíòàõ
'1.2 Èêîíêè òàíêîâ.': UndefPic := '2.bmp';
else
begin
LastIndex := UNDEF_INDEX;
InfoPic.Hide;
Exit;
end;
end;
if not FileExists(TempPath + UndefPic) then ExtractTemporaryFile(UndefPic);
ShowPicHint(TempPath + UndefPic);
finally
LastIndex := Index;
end;
end;


procedure CompOnMouseLeave(Sender: TObject);
begin
InfoPic.Hide;
LastIndex := -1;
end;


procedure InitInfo();
begin
WizardForm.TypesCombo.Hide;
WizardForm.ComponentsList.SetBounds(ScaleX(260), ScaleY(40), ScaleX(155), ScaleY(153));
WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove;
WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave;
TempPath := AddBackslash(ExpandConstant('{tmp}'));
LastIndex := UNDEF_INDEX;

with TBevel.Create(WizardForm) do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(0), ScaleY(40), ScaleX(253), ScaleY(203)); //ðàìêà êàðòèíêè
Shape := bsFrame;
end;

with TBevel.Create(WizardForm) do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(0), ScaleY(250), ScaleX(253), ScaleY(113)); //Íèæíèÿ ðàìêà
Shape := bsFrame;
end;

InfoPic := TBitmapImage.Create(WizardForm)
with InfoPic do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(1), ScaleY(251), ScaleX(250), ScaleY(110));
ExtractTemporaryFile('WizardForm.BitmapImage1.bmp');
Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardForm.BitmapImage1.bmp'));
end;
end;


procedure InitializeWizard();
begin
InitializeWizard1(); {èç BackUpPage.iss, åñëè ÷òî}
RedesignWizardForm;
InitInfo();
begin
WindowResize();
end;
end;


procedure ButtonLabelClick(Sender: TObject);
var
Button: TButton;
ButtonPanel: array [0..4] of TPanel;
ButtonImage: array [0..4] of TBitmapImage;
ButtonLabel: array [0..4] of TLabel;
begin
with WizardForm do
begin
case TLabel(Sender).Tag of
0: Button := BackButton;
1: Button := NextButton;
2: Button := CancelButton;
3: Button := DirBrowseButton;
4: Button := GroupBrowseButton;
else exit
end;
end;
Button.OnClick(Button);
end;

procedure ButtonLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ButtonImage[TLabel(Sender).Tag].Left:= -ScaleX({#ButtonWidth});
end;

procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ButtonImage[TLabel(Sender).Tag].Left := ScaleX(0);
end;

procedure LoadButtonImage(AButton: TButton; AButtonIndex: integer);
var
Image: TBitmapImage;
Panel: TPanel;
Labl: TLabel;
begin
Panel:=TPanel.Create(WizardForm)
with Panel do
begin
SetBounds(AButton.Left,AButton.Top,AButton.Width,AButton.Height);
Tag := AButtonIndex;
Parent := AButton.Parent;
end;

ButtonPanel[AButtonIndex] := Panel;

Image:=TBitmapImage.Create(WizardForm)
with Image do
begin
Width := ScaleX({#TextureWidth});
Height := ScaleY({#TextureHeight});
Enabled := False;
Bitmap.LoadFromResourceName(HInstance, '_IS_BUTTON');
Parent := Panel;
end;

ButtonImage[AButtonIndex]:=Image;

with TLabel.Create(WizardForm) do
begin
Tag := AButtonIndex;
Parent := Panel;
Width := Panel.Width;
Height := Panel.Height;
Transparent := True;
OnClick := @ButtonLabelClick;
OnDblClick := @ButtonLabelClick;
OnMouseDown := @ButtonLabelMouseDown;
OnMouseUp := @ButtonLabelMouseUp;
end;

Labl:=TLabel.Create(WizardForm)
with Labl do
begin
Autosize := True;
Alignment := taCenter;
Tag := AButtonIndex;
Transparent := True;
Font.Color := {#ButtonFontColor};
Caption := AButton.Caption;
OnClick := @ButtonLabelClick;
OnMouseDown := @ButtonLabelMouseDown;
OnMouseUp := @ButtonLabelMouseUp;
OnDblClick := @ButtonLabelClick;
Parent := Panel;
end;

ButtonLabel[AButtonIndex]:= Labl;
end;

procedure UpdateButton(AButton: TButton;AButtonIndex: integer);
begin
ButtonPanel[AButtonIndex].Visible := AButton.Visible;
with ButtonLabel[AButtonIndex] do
begin
Caption := AButton.Caption;
Left := ButtonPanel[AButtonIndex].Width div 2 - ButtonLabel[AButtonIndex].Width div 2;
Top := ButtonPanel[AButtonIndex].Height div 2 - ButtonLabel[AButtonIndex].Height div 2;
end;
end;


procedure InitializeWizard();
begin
with WizardForm do
begin
BackButton.Width:={#ButtonWidth};
BackButton.Height:={#ButtonHeight};
NextButton.Width:={#ButtonWidth};
NextButton.Height:={#ButtonHeight};
CancelButton.Width:={#ButtonWidth};
CancelButton.Height:={#ButtonHeight};
DirBrowseButton.Width:={#ButtonWidth};
DirBrowseButton.Height:={#ButtonHeight};
GroupBrowseButton.Width:={#ButtonWidth};
GroupBrowseButton.Height:={#ButtonHeight};

LoadButtonImage(BackButton,0);
LoadButtonImage(NextButton,1);
LoadButtonImage(CancelButton,2);
LoadButtonImage(DirBrowseButton,3);
LoadButtonImage(GroupBrowseButton,4);
end;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
UpdateButton(WizardForm.BackButton,0);
UpdateButton(WizardForm.NextButton,1);
UpdateButton(WizardForm.CancelButton,2);
UpdateButton(WizardForm.DirBrowseButton,3);
UpdateButton(WizardForm.GroupBrowseButton,4);
end;

А вот остальной код, так сказать фулл версия:)

'Развернуть'

#define MyAppName "Mod-Pack îò Darksoul" ;Íàçâàíèå èíñòàëëÿòîðà

#define MyInfoVer "10.1" ;Âåðñèÿ èíñòàëëÿòîðà
#define MyAppVer "10.1" ;Âåðñèÿ èãðû
#define Patch "0.9.1" ;âåðñèÿ ïàò÷à (÷òîáû íå ìåíÿòü ïîñëå êàæäîãî ïàò÷à ÷èñëà â ñêðèïòå, ìîæíî èñïîëüçîâàòü ýòî)
#define MyAppPublisher "Darksoul" ;Èìÿ êîìïàíèè èëè ÷åëîâåêà êòî äåëàë
#define MyAppURL "http://www.oceansoft.at.ua" ;Ññûëêà äëÿ ëîãî

#define ButtonWidth "80" ; øèðèíà êíîïêè
#define ButtonHeight "23" ; âûñîòà

#define ButtonFontColor "clWhite" ;öâåò øðèôòà êíîïîê

#define TextureWidth "160" ;øèðèíà êàðòèíêè-òåêñòóðû
#define TextureHeight "23" ;âûñîòà

#include "Components.iss" ;Êîìïàíåíòû, îíè æå ìîäû
#include "Messages.iss" ;Ñîîáùåíèå, íàäïèñè íà êíîïêàõ è ò.ä.
#include "BackUpPage.iss" ;Ðåçåðíîå êîïèðîâàíèå èëè óäàëåíèå res_mods
#define ButtonWidth "80" ; øèðèíà êíîïêè
#define ButtonHeight "23" ; âûñîòà

[setup]
AppName={#MyAppName}
AppVersion={#MyAppVer}
AppPublisher={#MyAppPublisher}

//====={ Ññûëêè }=====\\
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}

//====={ Ïàïêà óñòàíîêè }=====\\
;DefaultDirName={pf}\{#MyAppName}
DefaultDirName={reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{{1EAC1D02-C6AC-4FA6-9A44-96258C37C812RU%7d_is1,InstallLocation|{pf}\World_of_Tanks}
AppendDefaultDirName=no
DirExistsWarning=no
CreateUninstallRegKey=no
Uninstallable=yes

//====={ Êàðòèíêè }=====\\
SetupIconFile=Files\wot_ico.ico
WizardImageFile=Files\img3.bmp
WizardSmallImageFile=Files\Small2.bmp
BitmapResource=button:Files\button.bmp

//====={ Îòêëþ÷åíèå ñòðîíèö }=====\\
DisableProgramGroupPage=yes

//====={ Ëèöåíçèÿ è Ôàê }=====\\
LicenseFile=licensia.rtf
InfoBeforeFile=faq.rtf

//====={ Ñæàòèå ñåòàïà }=====\\
InternalCompressLevel=max
Compression=lzma2/max

[Files]
//------- âàøè êàðòèíêè ------------:
Source: image\1.bmp; Flags: dontcopy nocompression
Source: image\2.bmp; Flags: dontcopy nocompression

DestName: WizardForm.BitmapImage1.bmp; Source: Files\img123.bmp; Flags: dontcopy solidbreak


function WindowResize(): Boolean;
var
HeightOffset, WidthOffset: Integer;
begin
HeightOffset:=170;
WidthOffset:=200;

WizardForm.Height:=WizardForm.Height + HeightOffset;
WizardForm.Width:=WizardForm.Width + WidthOffset;

WizardForm.NextButton.Top:=WizardForm.NextButton.Top + HeightOffset;
WizardForm.BackButton.Top:=WizardForm.BackButton.Top + HeightOffset;
WizardForm.CancelButton.Top:=WizardForm.CancelButton.Top + HeightOffset;
WizardForm.NextButton.Left:=WizardForm.NextButton.Left + WidthOffset;
WizardForm.BackButton.Left:=WizardForm.BackButton.Left + WidthOffset;
WizardForm.CancelButton.Left:=WizardForm.CancelButton.Left + WidthOffset;

WizardForm.OuterNotebook.Height:=WizardForm.OuterNotebook.Height + HeightOffset;
WizardForm.InnerNotebook.Height:=WizardForm.InnerNotebook.Height + HeightOffset;
WizardForm.OuterNotebook.Width:=WizardForm.OuterNotebook.Width + WidthOffset;
WizardForm.InnerNotebook.Width:=WizardForm.InnerNotebook.Width + WidthOffset;
WizardForm.WizardSmallBitmapImage.Left:= WizardForm.WizardSmallBitmapImage.Left + WidthOffset;
WizardForm.Bevel.Top:=WizardForm.Bevel.Top + HeightOffset;
WizardForm.BeveledLabel.Top:=WizardForm.BeveledLabel.Top + HeightOffset;
WizardForm.Bevel.Width:=WizardForm.Bevel.Width + WidthOffset;
WizardForm.Bevel1.Width:=WizardForm.Bevel1.Width + WidthOffset;
WizardForm.MainPanel.Width:=WizardForm.MainPanel.Width + WidthOffset;
WizardForm.BeveledLabel.Width:=WizardForm.BeveledLabel.Width + WidthOffset;
WizardForm.Center;

{ /// --- Ðàñêîììåíòèðîâàòü ïðè æåëàíèè ---- ///
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.WizardBitmapImage.Width:=600;
WizardForm.WizardBitmapImage.Height:=400;
WizardForm.WizardBitmapImage2.Width:=600;
WizardForm.WizardBitmapImage2.Height:=400;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
WizardForm.WizardSmallBitmapImage.Top:=0;
WizardForm.WizardSmallBitmapImage.Left:=0;
WizardForm.WizardSmallBitmapImage.Width:=WizardForm.Width;
WizardForm.WizardSmallBitmapImage.Height:=58;
/// --- Êîíåö ---- ///
}
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.WizardBitmapImage.Width:=697;
WizardForm.WizardBitmapImage.Height:=483;

WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.YesRadio.Hide;
WizardForm.NoRadio.Hide;
WizardForm.WizardBitmapImage2.Width:=697;
WizardForm.WizardBitmapImage2.Height:=483;

WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
WizardForm.WizardSmallBitmapImage.Top:=0;
WizardForm.WizardSmallBitmapImage.Left:=0;
WizardForm.WizardSmallBitmapImage.Width:=697;
WizardForm.WizardSmallBitmapImage.Height:=58;

WizardForm.WelcomeLabel1.Width:=WizardForm.WelcomeLabel1.Width + WidthOffset;
WizardForm.WelcomeLabel1.Height:=WizardForm.WelcomeLabel1.Height + HeightOffset;
WizardForm.WelcomeLabel1.Width:=WizardForm.WelcomeLabel1.Width + WidthOffset;

WizardForm.WelcomeLabel2.Width:=WizardForm.WelcomeLabel2.Width + WidthOffset;
WizardForm.WelcomeLabel2.Height:=WizardForm.WelcomeLabel2.Height + HeightOffset;
WizardForm.WelcomeLabel2.Width:=WizardForm.WelcomeLabel2.Width + WidthOffset;


WizardForm.LicenseLabel1.Width:=WizardForm.LicenseLabel1.Width + WidthOffset;
WizardForm.LicenseMemo.Height:=WizardForm.LicenseMemo.Height + HeightOffset;
WizardForm.LicenseMemo.Width:=WizardForm.LicenseMemo.Width + WidthOffset;
WizardForm.LicenseNotAcceptedRadio.Top:=WizardForm.LicenseNotAcceptedRadio.Top + HeightOffset;
WizardForm.LicenseAcceptedRadio.Top:=WizardForm.LicenseAcceptedRadio.Top + HeightOffset;

WizardForm.InfoBeforeClickLabel.Width:=WizardForm.InfoBeforeClickLabel.Width + WidthOffset;
WizardForm.InfoBeforeMemo.Height:=WizardForm.InfoBeforeMemo.Height + HeightOffset;
WizardForm.InfoBeforeMemo.Width:=WizardForm.InfoBeforeMemo.Width + WidthOffset;

WizardForm.SelectDirLabel.Width:=WizardForm.SelectDirLabel.Width + WidthOffset;
WizardForm.SelectDirBrowseLabel.Width:=WizardForm.SelectDirBrowseLabel.Width + WidthOffset;
WizardForm.DiskSpaceLabel.Top:=WizardForm.DiskSpaceLabel.Top + HeightOffset;
WizardForm.DirBrowseButton.Left:=WizardForm.DirBrowseButton.Left + HeightOffset;
WizardForm.DirEdit.Width:=WizardForm.DirEdit.Width + HeightOffset;

WizardForm.ComponentsDiskSpaceLabel.Top:=WizardForm.ComponentsDiskSpaceLabel.Top + HeightOffset;
WizardForm.SelectComponentsLabel.Width:=WizardForm.SelectComponentsLabel.Width + WidthOffset;
WizardForm.ComponentsList.Height:=WizardForm.ComponentsList.Height + HeightOffset;
WizardForm.ComponentsList.Width:=WizardForm.ComponentsList.Width + WidthOffset;

WizardForm.ReadyLabel.Width:=WizardForm.ReadyLabel.Width + WidthOffset;
WizardForm.ReadyMemo.Height:=WizardForm.ReadyMemo.Height + HeightOffset;
WizardForm.ReadyMemo.Width:=WizardForm.ReadyMemo.Width + WidthOffset;

WizardForm.ProgressGauge.Width:=WizardForm.ProgressGauge.Width + HeightOffset;
WizardForm.FilenameLabel.Width:=WizardForm.FilenameLabel.Width + HeightOffset;
WizardForm.StatusLabel.Width:=WizardForm.StatusLabel.Width + HeightOffset;
end;

/// --- /// --- /// --- /// --- /// --- /// --- /// --- /// --- /// --- /// --- /// --- ///

procedure RedesignWizardForm;
begin
with WizardForm do
begin
AutoScroll := False;
end;
end;

const
UNDEF_INDEX = -777;

function GetCursorPos(var lpPoint: TPoint): BOOL; external '[email protected] stdcall';

var
InfoPic: TBitmapImage;
LastIndex: Integer;
TempPath: String;

procedure ShowPicHint(const PicFilePath: String);
var
pt: TPoint;
begin
if not GetCursorPos(pt) then Exit;
InfoPic.Bitmap.LoadFromFile(PicFilePath);
InfoPic.SetBounds(ScaleX(1), ScaleY(41), ScaleX(250), ScaleY(200)); // êàðòèíêà
InfoPic.Show;
end;

procedure CompOnItemMouseMove(Sender: TObject; X, Y: Integer; Index: Integer; Area: TItemArea);
var
UndefPic: String;
begin
if Index = -1 then Exit;
if Index = LastIndex then Exit;
try
case TNewCheckListBox(Sender).ItemCaption[index] of
//-----------------------ÊÀÐÒÈÍÊÈ----------------------------\\
'1. Êîìïëåêñíûé ìîä XVM v2.1': UndefPic := '1.bmp'; // ïèøåì òî÷íî òàê æå, êàê ïðîïèñàíî â êîìïîíåíòàõ
'1.2 Èêîíêè òàíêîâ.': UndefPic := '2.bmp';
else
begin
LastIndex := UNDEF_INDEX;
InfoPic.Hide;
Exit;
end;
end;
if not FileExists(TempPath + UndefPic) then ExtractTemporaryFile(UndefPic);
ShowPicHint(TempPath + UndefPic);
finally
LastIndex := Index;
end;
end;


procedure CompOnMouseLeave(Sender: TObject);
begin
InfoPic.Hide;
LastIndex := -1;
end;


procedure InitInfo();
begin
WizardForm.TypesCombo.Hide;
WizardForm.ComponentsList.SetBounds(ScaleX(260), ScaleY(40), ScaleX(155), ScaleY(153));
WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove;
WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave;
TempPath := AddBackslash(ExpandConstant('{tmp}'));
LastIndex := UNDEF_INDEX;

with TBevel.Create(WizardForm) do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(0), ScaleY(40), ScaleX(253), ScaleY(203)); //ðàìêà êàðòèíêè
Shape := bsFrame;
end;

with TBevel.Create(WizardForm) do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(0), ScaleY(250), ScaleX(253), ScaleY(113)); //Íèæíèÿ ðàìêà
Shape := bsFrame;
end;

InfoPic := TBitmapImage.Create(WizardForm)
with InfoPic do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(1), ScaleY(251), ScaleX(250), ScaleY(110));
ExtractTemporaryFile('WizardForm.BitmapImage1.bmp');
Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardForm.BitmapImage1.bmp'));
end;
end;


procedure InitializeWizard();
begin
InitializeWizard1(); {èç BackUpPage.iss, åñëè ÷òî}
RedesignWizardForm;
InitInfo();
begin
WindowResize();
end;
end;


procedure ButtonLabelClick(Sender: TObject);
var
Button: TButton;
ButtonPanel: array [0..4] of TPanel;
ButtonImage: array [0..4] of TBitmapImage;
ButtonLabel: array [0..4] of TLabel;
begin
with WizardForm do
begin
case TLabel(Sender).Tag of
0: Button := BackButton;
1: Button := NextButton;
2: Button := CancelButton;
3: Button := DirBrowseButton;
4: Button := GroupBrowseButton;
else exit
end;
end;
Button.OnClick(Button);
end;

procedure ButtonLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ButtonImage[TLabel(Sender).Tag].Left:= -ScaleX({#ButtonWidth});
end;

procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ButtonImage[TLabel(Sender).Tag].Left := ScaleX(0);
end;

procedure LoadButtonImage(AButton: TButton; AButtonIndex: integer);
var
Image: TBitmapImage;
Panel: TPanel;
Labl: TLabel;
begin
Panel:=TPanel.Create(WizardForm)
with Panel do
begin
SetBounds(AButton.Left,AButton.Top,AButton.Width,AButton.Height);
Tag := AButtonIndex;
Parent := AButton.Parent;
end;

ButtonPanel[AButtonIndex] := Panel;

Image:=TBitmapImage.Create(WizardForm)
with Image do
begin
Width := ScaleX({#TextureWidth});
Height := ScaleY({#TextureHeight});
Enabled := False;
Bitmap.LoadFromResourceName(HInstance, '_IS_BUTTON');
Parent := Panel;
end;

ButtonImage[AButtonIndex]:=Image;

with TLabel.Create(WizardForm) do
begin
Tag := AButtonIndex;
Parent := Panel;
Width := Panel.Width;
Height := Panel.Height;
Transparent := True;
OnClick := @ButtonLabelClick;
OnDblClick := @ButtonLabelClick;
OnMouseDown := @ButtonLabelMouseDown;
OnMouseUp := @ButtonLabelMouseUp;
end;

Labl:=TLabel.Create(WizardForm)
with Labl do
begin
Autosize := True;
Alignment := taCenter;
Tag := AButtonIndex;
Transparent := True;
Font.Color := {#ButtonFontColor};
Caption := AButton.Caption;
OnClick := @ButtonLabelClick;
OnMouseDown := @ButtonLabelMouseDown;
OnMouseUp := @ButtonLabelMouseUp;
OnDblClick := @ButtonLabelClick;
Parent := Panel;
end;

ButtonLabel[AButtonIndex]:= Labl;
end;

procedure UpdateButton(AButton: TButton;AButtonIndex: integer);
begin
ButtonPanel[AButtonIndex].Visible := AButton.Visible;
with ButtonLabel[AButtonIndex] do
begin
Caption := AButton.Caption;
Left := ButtonPanel[AButtonIndex].Width div 2 - ButtonLabel[AButtonIndex].Width div 2;
Top := ButtonPanel[AButtonIndex].Height div 2 - ButtonLabel[AButtonIndex].Height div 2;
end;
end;


procedure InitializeWizard();
begin
with WizardForm do
begin
BackButton.Width:={#ButtonWidth};
BackButton.Height:={#ButtonHeight};
NextButton.Width:={#ButtonWidth};
NextButton.Height:={#ButtonHeight};
CancelButton.Width:={#ButtonWidth};
CancelButton.Height:={#ButtonHeight};
DirBrowseButton.Width:={#ButtonWidth};
DirBrowseButton.Height:={#ButtonHeight};
GroupBrowseButton.Width:={#ButtonWidth};
GroupBrowseButton.Height:={#ButtonHeight};

LoadButtonImage(BackButton,0);
LoadButtonImage(NextButton,1);
LoadButtonImage(CancelButton,2);
LoadButtonImage(DirBrowseButton,3);
LoadButtonImage(GroupBrowseButton,4);
end;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
UpdateButton(WizardForm.BackButton,0);
UpdateButton(WizardForm.NextButton,1);
UpdateButton(WizardForm.CancelButton,2);
UpdateButton(WizardForm.DirBrowseButton,3);
UpdateButton(WizardForm.GroupBrowseButton,4);
end;

post-21541-0-09860600-1402203305_thumb.png

Edited by Darksoul

Share this post


Link to post

Short link
Share on other sites

всё, скрины рабочего модпака в теме, которую мне предложили, нашлись люди, которые помогли, спасибо им, да вообще всем спасибо, тему можно закрывать.

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...