обновление
This commit is contained in:
BIN
project1.ico
Normal file
BIN
project1.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 283 KiB |
83
project1.lpi
Normal file
83
project1.lpi
Normal file
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="12"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<Title Value="Hytale Launcher"/>
|
||||
<Scaled Value="True"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<XPManifest>
|
||||
<DpiAware Value="True/PM_V2"/>
|
||||
<TextName Value="Hytale Launcher"/>
|
||||
<TextDesc Value="Hytale Launcher"/>
|
||||
</XPManifest>
|
||||
<Icon Value="0"/>
|
||||
</General>
|
||||
<BuildModes>
|
||||
<Item Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<UseFileFilters Value="True"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
</RunParams>
|
||||
<RequiredPackages>
|
||||
<Item>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item>
|
||||
</RequiredPackages>
|
||||
<Units>
|
||||
<Unit>
|
||||
<Filename Value="project1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit>
|
||||
<Unit>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
</Unit>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="Hytale_Launcher"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<DebugInfoType Value="dsDwarf3"/>
|
||||
</Debugging>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions>
|
||||
<Item>
|
||||
<Name Value="EAbort"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
||||
29
project1.lpr
Normal file
29
project1.lpr
Normal file
@@ -0,0 +1,29 @@
|
||||
program project1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}
|
||||
cthreads,
|
||||
{$ENDIF}
|
||||
{$IFDEF HASAMIGA}
|
||||
athreads,
|
||||
{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, Unit1
|
||||
{ you can add units after this };
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
RequireDerivedFormResource:=True;
|
||||
Application.Title:='Hytale Launcher';
|
||||
Application.Scaled:=True;
|
||||
{$PUSH}{$WARN 5044 OFF}
|
||||
Application.MainFormOnTaskbar:=True;
|
||||
{$POP}
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
||||
164
project1.lps
Normal file
164
project1.lps
Normal file
@@ -0,0 +1,164 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectSession>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="12"/>
|
||||
<BuildModes Active="Default"/>
|
||||
<Units>
|
||||
<Unit>
|
||||
<Filename Value="project1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<WindowIndex Value="-1"/>
|
||||
<UsageCount Value="42"/>
|
||||
</Unit>
|
||||
<Unit>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<TopLine Value="129"/>
|
||||
<CursorPos X="9" Y="146"/>
|
||||
<UsageCount Value="42"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
</Unit>
|
||||
<Unit>
|
||||
<Filename Value="C:\lazarus\lcl\include\customform.inc"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="963"/>
|
||||
<CursorPos Y="1007"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit>
|
||||
</Units>
|
||||
<JumpHistory HistoryIndex="29">
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="168" Column="3" TopLine="148"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="161" TopLine="146"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="171" Column="18" TopLine="147"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="170" Column="18" TopLine="16"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="26" Column="70" TopLine="10"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="27" Column="48" TopLine="12"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="27" Column="48" TopLine="12"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="26" Column="70" TopLine="11"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="27" Column="48" TopLine="11"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="26" Column="70" TopLine="11"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="92" Column="34" TopLine="79"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Column="50"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="91" TopLine="76"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="92" TopLine="76"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="93" TopLine="76"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="53" Column="24" TopLine="37"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="51" Column="6" TopLine="35"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="53" Column="33" TopLine="37"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="102" TopLine="85"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="104" TopLine="85"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="105" TopLine="85"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="88" TopLine="81"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="107" TopLine="82"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="88" TopLine="82"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="107" TopLine="82"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="172" TopLine="145"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="124" TopLine="97"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="130" TopLine="121"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="135" Column="16" TopLine="126"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="138" TopLine="125"/>
|
||||
</Position>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
<Modes ActiveMode=""/>
|
||||
</RunParams>
|
||||
</ProjectSession>
|
||||
</CONFIG>
|
||||
BIN
project1.res
Normal file
BIN
project1.res
Normal file
Binary file not shown.
162
unit1.pas
Normal file
162
unit1.pas
Normal file
@@ -0,0 +1,162 @@
|
||||
unit Unit1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
Image1: TImage;
|
||||
Image2: TImage;
|
||||
Image3: TImage;
|
||||
Image4: TImage;
|
||||
Image5: TImage;
|
||||
player_name_edit: TEdit;
|
||||
procedure start_btnClick(Sender: TObject);
|
||||
procedure exit_btnClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
|
||||
procedure Image1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
private
|
||||
procedure SetPlayerName();
|
||||
public
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
PLAYER_UUID: String;
|
||||
PLAYER_NAME: String;
|
||||
PX, PY: Integer;
|
||||
MouseIsDown: Boolean;
|
||||
const
|
||||
Hytale_Dir = '.\package\game\latest\Client\';
|
||||
//JAVA_EXE = '.\package\jre\latest\bin\java.exe';
|
||||
|
||||
implementation
|
||||
|
||||
function GenerateUniqueID: string;
|
||||
var
|
||||
guid: TGUID;
|
||||
guidStr: string;
|
||||
begin
|
||||
Result := '';
|
||||
if CreateGUID(guid) = 0 then
|
||||
begin
|
||||
guidStr := GUIDToString(guid); // Получаем GUID со скобками
|
||||
guidStr := StringReplace(guidStr, '{', '', [rfReplaceAll]); // Удаляем '{'
|
||||
guidStr := StringReplace(guidStr, '}', '', [rfReplaceAll]); // Удаляем '}'
|
||||
Result := guidStr;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
begin
|
||||
if Button = mbLeft then
|
||||
begin
|
||||
MouseIsDown := True;
|
||||
PX := X;
|
||||
PY := Y;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
|
||||
begin
|
||||
if MouseIsDown then
|
||||
begin
|
||||
SetBounds(Form1.Left + (X - PX), Form1.Top + (Y - PY), Form1.Width, Form1.Height);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
begin
|
||||
MouseIsDown := False;
|
||||
end;
|
||||
|
||||
procedure GenerateID();
|
||||
var
|
||||
f: TextFile;
|
||||
FileContent: string;
|
||||
tmp_uuid: string;
|
||||
begin
|
||||
if not FileExists(Hytale_Dir+'uuid.txt') then
|
||||
begin
|
||||
tmp_uuid:= GenerateUniqueID();
|
||||
AssignFile(f, Hytale_Dir+'uuid.txt');
|
||||
Rewrite(f);
|
||||
Write(f, AnsiLowerCase(tmp_uuid));
|
||||
CloseFile(f);
|
||||
PLAYER_UUID:=AnsiLowerCase(tmp_uuid);
|
||||
end
|
||||
else
|
||||
begin
|
||||
AssignFile(f, Hytale_Dir+'uuid.txt');
|
||||
Reset(f);
|
||||
Read(f, FileContent);
|
||||
CloseFile(f);
|
||||
PLAYER_UUID:=FileContent;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.SetPlayerName();
|
||||
var
|
||||
f: TextFile;
|
||||
FileContent: string;
|
||||
begin
|
||||
if FileExists(Hytale_Dir+'username.txt') then
|
||||
begin
|
||||
AssignFile(f,Hytale_Dir+'username.txt');
|
||||
Reset(f);
|
||||
Read(f, FileContent);
|
||||
CloseFile(f);
|
||||
player_name_edit.Text:=FileContent;
|
||||
PLAYER_NAME:=FileContent;
|
||||
end
|
||||
end;
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.start_btnClick(Sender: TObject);
|
||||
|
||||
var
|
||||
f: TextFile;
|
||||
Parameters: string;
|
||||
APath, JAVA_EXE: String;
|
||||
begin
|
||||
APath:= ExtractFilePath(Application.ExeName);
|
||||
JAVA_EXE:= APath+'package\jre\latest\bin\java.exe';
|
||||
APath:= APath+'package\game\latest\';
|
||||
|
||||
AssignFile(f, Hytale_Dir+'username.txt');
|
||||
Rewrite(f);
|
||||
Write(f, player_name_edit.Text);
|
||||
CloseFile(f);
|
||||
|
||||
Parameters:= '--app-dir '+APath+' --java-exec '+JAVA_EXE+' --auth-mode offline --uuid '+PLAYER_UUID+' --name '+PLAYER_NAME;
|
||||
//ShowMessage(Parameters);
|
||||
ExecuteProcess(APath+'Client\HytaleClient.exe', Parameters);
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TForm1.exit_btnClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormShow(Sender: TObject);
|
||||
|
||||
begin
|
||||
SetPlayerName();
|
||||
GenerateID();
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user