Initial commit
- Basic interface setup - Basic object structure worked out
30
ChivalryServerLauncher.dpr
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
program ChivalryServerLauncher;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Vcl.Forms,
|
||||||
|
Forms.Main in 'source\view\Forms.Main.pas' {MainForm},
|
||||||
|
Game.Base in 'source\model\Game.Base.pas',
|
||||||
|
Game.Chivalry.MedievalWarfare in 'source\model\Game.Chivalry.MedievalWarfare.pas',
|
||||||
|
Game.Intf in 'source\model\Game.Intf.pas',
|
||||||
|
Game.Chivalry in 'source\model\Game.Chivalry.pas',
|
||||||
|
Game.Registry in 'source\model\Game.Registry.pas',
|
||||||
|
Resources in 'source\Resources.pas',
|
||||||
|
Game.Map in 'source\model\Game.Map.pas',
|
||||||
|
Forms.Game in 'source\view\Forms.Game.pas' {GameForm},
|
||||||
|
Bindings.Converters in 'source\bindings\Bindings.Converters.pas',
|
||||||
|
Game.List in 'source\model\Game.List.pas',
|
||||||
|
Persist.GameList in 'source\persist\Persist.GameList.pas';
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
|
||||||
|
var
|
||||||
|
MainForm: TMainForm;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.MainFormOnTaskbar := True;
|
||||||
|
Application.CreateForm(TMainForm, MainForm);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
214
ChivalryServerLauncher.dproj
Normal file
@ -0,0 +1,214 @@
|
|||||||
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ProjectGuid>{4CC5BE6F-BC4C-47D6-B434-FB070B81999F}</ProjectGuid>
|
||||||
|
<ProjectVersion>13.4</ProjectVersion>
|
||||||
|
<FrameworkType>VCL</FrameworkType>
|
||||||
|
<MainSource>ChivalryServerLauncher.dpr</MainSource>
|
||||||
|
<Base>True</Base>
|
||||||
|
<Config Condition="'$(Config)'==''">Build</Config>
|
||||||
|
<Platform Condition="'$(Platform)'==''">Win64</Platform>
|
||||||
|
<TargetedPlatforms>3</TargetedPlatforms>
|
||||||
|
<AppType>Application</AppType>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
|
||||||
|
<Base_Win64>true</Base_Win64>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
|
||||||
|
<Base_Win32>true</Base_Win32>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Build' or '$(Cfg_1)'!=''">
|
||||||
|
<Cfg_1>true</Cfg_1>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win64)'!=''">
|
||||||
|
<Cfg_1_Win64>true</Cfg_1_Win64>
|
||||||
|
<CfgParent>Cfg_1</CfgParent>
|
||||||
|
<Cfg_1>true</Cfg_1>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
|
||||||
|
<Cfg_1_Win32>true</Cfg_1_Win32>
|
||||||
|
<CfgParent>Cfg_1</CfgParent>
|
||||||
|
<Cfg_1>true</Cfg_1>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Base)'!=''">
|
||||||
|
<VerInfo_Keys>CompanyName=X²Software;FileDescription=Chivalry Server Launcher;FileVersion=0.1.0.0;InternalName=;LegalCopyright=Copyright (c) 2014 X²Software;LegalTrademarks=;OriginalFilename=ChivalryServerLauncher.exe;ProductName=Chivalry Server Launcher;ProductVersion=0.1</VerInfo_Keys>
|
||||||
|
<VerInfo_MinorVer>1</VerInfo_MinorVer>
|
||||||
|
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||||
|
<VerInfo_Locale>1043</VerInfo_Locale>
|
||||||
|
<VerInfo_MajorVer>0</VerInfo_MajorVer>
|
||||||
|
<Icon_MainIcon>resources\icons\MainIcon.ico</Icon_MainIcon>
|
||||||
|
<Manifest_File>None</Manifest_File>
|
||||||
|
<DCC_UsePackage>fmx;IndySystem;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapServer;DataSnapProviderClient;DbxCommonDriver;dbxcds;DBXOracleDriver;CustomIPTransport;dsnap;fmxase;IndyCore;CloudService;FmxTeeUI;inetdbxpress;IPIndyImpl;bindcompfmx;rtl;dbrtl;DbxClientDriver;bindcomp;inetdb;xmlrtl;ibxpress;IndyProtocols;DBXMySQLDriver;soaprtl;bindengine;FMXTee;DBXInformixDriver;DBXFirebirdDriver;inet;fmxobj;DBXSybaseASADriver;fmxdae;dbexpress;DataSnapIndy10ServerTransport;$(DCC_UsePackage)</DCC_UsePackage>
|
||||||
|
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
|
||||||
|
<DCC_DcuOutput>.\lib\$(Platform)\</DCC_DcuOutput>
|
||||||
|
<DCC_ExeOutput>.\bin\$(Platform)\</DCC_ExeOutput>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Base_Win64)'!=''">
|
||||||
|
<DCC_DcuOutput>.\lib\$(Platform)\</DCC_DcuOutput>
|
||||||
|
<DCC_ExeOutput>.\bin\$(Platform)\</DCC_ExeOutput>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Base_Win32)'!=''">
|
||||||
|
<DCC_UsePackage>JvBDE;JvGlobus;JvMM;JvManagedThreads;TeeDB;JvDlgs;JvCrypt;rbDIDE1516;vclib;inetdbbde;DBXSybaseASEDriver;JvDotNetCtrls;JvNet;vclimg;rbTCUI1516;rbTC1516;fmi;JvXPCtrls;rbRCL1516;rbDAD1516;vcldb;vcldsnap;X2CLGL;rbIBE1516;DBXDb2Driver;dclRBBDE1516;rbDB1516;JvCore;dclRBIBE1516;dclRBADO1516;vcl;DBXMSSQLDriver;CodeSiteExpressPkg;rbRAP1516;JvAppFrm;JvDB;JvRuntimeDesign;webdsnap;X2CLMB;OmniThreadLibraryRuntimeXE2;JclDeveloperTools;rbRIDE1516;adortl;JvDocking;JvWizards;rbADO1516;madBasic_;JvHMI;JvBands;vcldbx;rbDBDE1516;dclRBE1516;JvPluginSystem;rbIDE1516;Tee;rbUSERDesign1516;DBXOdbcDriver;JvCmp;madDisAsm_;JvSystem;svnui;JvControls;JvTimeFramework;TeeUI;vclactnband;bindcompvcl;vclie;Jcl;madExcept_;JvStdCtrls;vcltouch;JvCustom;JvJans;websnap;JvPageComps;JvPrintPreview;rbBDE1516;rbUSER1516;dclRBDBE1516;VclSmp;DataSnapConnectors;dsnapcon;JclVcl;JvPascalInterpreter;vclx;rbCIDE1516;svn;rbDBE1516;bdertl;VirtualTreesR;$(DCC_UsePackage)</DCC_UsePackage>
|
||||||
|
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
|
||||||
|
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_1)'!=''">
|
||||||
|
<DCC_Optimize>false</DCC_Optimize>
|
||||||
|
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
|
||||||
|
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
|
||||||
|
<DCC_RemoteDebug>true</DCC_RemoteDebug>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
|
||||||
|
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
|
||||||
|
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
|
||||||
|
<DCC_RemoteDebug>false</DCC_RemoteDebug>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<DelphiCompile Include="$(MainSource)">
|
||||||
|
<MainSource>MainSource</MainSource>
|
||||||
|
</DelphiCompile>
|
||||||
|
<DCCReference Include="source\view\Forms.Main.pas">
|
||||||
|
<Form>MainForm</Form>
|
||||||
|
<FormType>dfm</FormType>
|
||||||
|
</DCCReference>
|
||||||
|
<DCCReference Include="source\model\Game.Base.pas"/>
|
||||||
|
<DCCReference Include="source\model\Game.Chivalry.MedievalWarfare.pas"/>
|
||||||
|
<DCCReference Include="source\model\Game.Intf.pas"/>
|
||||||
|
<DCCReference Include="source\model\Game.Chivalry.pas"/>
|
||||||
|
<DCCReference Include="source\model\Game.Registry.pas"/>
|
||||||
|
<DCCReference Include="source\Resources.pas"/>
|
||||||
|
<DCCReference Include="source\model\Game.Map.pas"/>
|
||||||
|
<DCCReference Include="source\view\Forms.Game.pas">
|
||||||
|
<Form>GameForm</Form>
|
||||||
|
<FormType>dfm</FormType>
|
||||||
|
</DCCReference>
|
||||||
|
<DCCReference Include="source\bindings\Bindings.Converters.pas"/>
|
||||||
|
<DCCReference Include="source\model\Game.List.pas"/>
|
||||||
|
<DCCReference Include="source\persist\Persist.GameList.pas"/>
|
||||||
|
<BuildConfiguration Include="Base">
|
||||||
|
<Key>Base</Key>
|
||||||
|
</BuildConfiguration>
|
||||||
|
<BuildConfiguration Include="Build">
|
||||||
|
<Key>Cfg_1</Key>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
</BuildConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<ProjectExtensions>
|
||||||
|
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
|
||||||
|
<Borland.ProjectType/>
|
||||||
|
<BorlandProject>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1043</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1252</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="CompanyName"/>
|
||||||
|
<VersionInfoKeys Name="FileDescription"/>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="InternalName"/>
|
||||||
|
<VersionInfoKeys Name="LegalCopyright"/>
|
||||||
|
<VersionInfoKeys Name="LegalTrademarks"/>
|
||||||
|
<VersionInfoKeys Name="OriginalFilename"/>
|
||||||
|
<VersionInfoKeys Name="ProductName"/>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="Comments"/>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">ChivalryServerLauncher.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxCoreRS16.bpl">ExpressCoreLibrary by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxLibraryRS16.bpl">Express Cross Platform Library by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxPageControlRS16.bpl">ExpressPageControl by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxServerModeRS16.bpl">ExpressDataController Server Mode by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxEditorsRS16.bpl">ExpressEditors Library by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxWizardControlRS16.bpl">ExpressWizardControl by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxBarRS16.bpl">ExpressBars by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxSchedulerRS16.bpl">ExpressScheduler by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxGridRS16.bpl">ExpressQuantumGrid by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPSCoreRS16.bpl">ExpressPrinting System by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPSTeeChartRS16.bpl">ExpressPrinting System ReportLink for TeeChart by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxPivotGridRS16.bpl">ExpressPivotGrid by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxOrgCRS16.bpl">ExpressOrgChart by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPSdxLCLnkRS16.bpl">ExpressPrinting System ReportLink for ExpressLayoutControl by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxDBXServerModeRS16.bpl">dbExpress Data Source for ExpressDataController Server Mode by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxADOServerModeRS16.bpl">ADO Data Source for ExpressDataController Server Mode by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxEditorFieldLinkRS16.bpl">ExpressEditors FieldLink by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxBarEditItemRS16.bpl">ExpressBars cxEditor item by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxBarExtDBItemsRS16.bpl">ExpressBars extended DB items by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxBarExtItemsRS16.bpl">ExpressBars extended items by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxBarDBNavRS16.bpl">ExpressBars DBNavigator by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxRibbonRS16.bpl">ExpressBars Ribbon controls by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxTabbedMDIRS16.bpl">ExpressBars Tabbed MDI by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxDockingRS16.bpl">ExpressDocking Library by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxLayoutControlRS16.bpl">ExpressLayout Control by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxTreeListRS16.bpl">ExpressQuantumTreeList by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxmdsRS16.bpl">ExpressMemData by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxSpreadSheetRS16.bpl">ExpressSpreadSheet by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxNavBarRS16.bpl">ExpressNavBar by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPSLnksRS16.bpl">ExpressPrinting System ReportLinks (Standard) by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPSDBTeeChartRS16.bpl">ExpressPrinting System ReportLink for DBTeeChart by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dxPScxPCProdRS16.bpl">ExpressPrinting System ContainerProducer for ExpressPageControl by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxPivotGridOLAPRS16.bpl">ExpressPivotGrid OLAP by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxdbtrRS16.bpl">ExpressDBTree by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxtrmdRS16.bpl">ExpressTreePrintedDataSet by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxDBOrRS16.bpl">ExpressDBOrgChart by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxFlowChartRS16.bpl">ExpressFlowChart by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxIconLibraryRS16.bpl">Express Cross Platform Library Icon Library by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxPageControldxBarPopupMenuRS16.bpl">ExpressPageControl dxBar Popup Menu by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxSchedulerRibbonStyleEventEditorRS16.bpl">ExpressScheduler Ribbon Event Window by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxSchedulerGridRS16.bpl">ExpressScheduler connection to ExpressQuantumGrid by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxSchedulerTreeBrowserRS16.bpl">ExpressScheduler tree browser by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxTreeListdxBarPopupMenuRS16.bpl">ExpressQuantumTreeList dxBar Built-In Menu by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxGridWizardRS16.bpl">ExpressQuantumGrid Wizard by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPScxCommonRS16.bpl">ExpressPrinting System Cross Platform Library by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPScxExtCommonRS16.bpl">ExpressPrinting System Extended Cross Platform Library by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPScxPivotGridLnkRS16.bpl">ExpressPrinting System ReportLink for ExpressPivotGrid by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPScxSchedulerLnkRS16.bpl">ExpressPrinting System ReportLink for ExpressScheduler by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPScxSSLnkRS16.bpl">ExpressPrinting System ReportLink for ExpressSpreadSheet by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPScxTLLnkRS16.bpl">ExpressPrinting System ReportLink for ExpressQuantumTreeList by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPSdxDBOCLnkRS16.bpl">ExpressPrinting System ReportLinks for ExpressDBOrgChart by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPSdxDBTVLnkRS16.bpl">ExpressPrinting System ReportLink for ExpressDBTree by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPSdxFCLnkRS16.bpl">ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPScxGridLnkRS16.bpl">ExpressPrinting System ReportLink for ExpressQuantumGrid by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPSdxOCLnkRS16.bpl">ExpressPrinting System ReportLinks for ExpressOrgChart by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPSPrVwAdvRS16.bpl">ExpressPrinting System Advanced Preview Window by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dcldxPSPrVwRibbonRS16.bpl">ExpressPrinting System Ribbon Preview Window by Developer Express Inc.</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="D:\Program Files\Developer Express.VCL\Library\RS16\dclcxPivotGridChartRS16.bpl">ExpressPivotGrid connection to ExpressQuantumGrid Chart View by Developer Express Inc.</Excluded_Packages>
|
||||||
|
</Excluded_Packages>
|
||||||
|
</Delphi.Personality>
|
||||||
|
<Deployment/>
|
||||||
|
<Platforms>
|
||||||
|
<Platform value="Win64">True</Platform>
|
||||||
|
<Platform value="Win32">True</Platform>
|
||||||
|
</Platforms>
|
||||||
|
</BorlandProject>
|
||||||
|
<ProjectFileVersion>12</ProjectFileVersion>
|
||||||
|
</ProjectExtensions>
|
||||||
|
<Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
|
||||||
|
<Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
|
||||||
|
</Project>
|
BIN
ChivalryServerLauncher.res
Normal file
76
assets/Chivalry.MedievalWarfare.MapList.ini
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
[Team Objective]
|
||||||
|
AOCTO-Battlegrounds_v3_P=Battlegrounds
|
||||||
|
AOCTO-Darkforest_p=Dark forest
|
||||||
|
AOCTO-Hillside_P=Hillside
|
||||||
|
AOCTO-Stoneshill_P=Stoneshill
|
||||||
|
AOCTO-Citadel_p=Citadel
|
||||||
|
|
||||||
|
[Capture the Flag]
|
||||||
|
AOCCTF-Frigid_p=Frigid
|
||||||
|
AOCCTF-Moor_p=Moor
|
||||||
|
AOCCTF-Ruins_Large_P=Ruins Large
|
||||||
|
AOCCTF-Ruins_P=Ruins
|
||||||
|
|
||||||
|
[Duel]
|
||||||
|
AOCDuel-Arena_Flat_p=Arena Flat
|
||||||
|
AOCDuel-Arena_p=Arena
|
||||||
|
AOCDuel-Bridge_p=Bridge
|
||||||
|
AOCDuel-Cistern_p=Cistern
|
||||||
|
AOCDuel-Courtyard_p=Courtyard
|
||||||
|
AOCDuel-Dininghall_p=Dining hall
|
||||||
|
AOCDuel-FrostPeak_p=Frost Peak
|
||||||
|
AOCDuel-Mines_p=Mines
|
||||||
|
AOCDuel-Shaft_p=Shaft
|
||||||
|
AOCDuel-Shipyard_p=Shipyard
|
||||||
|
AOCDuel-ThroneRoom_p=Throne Room
|
||||||
|
AOCDuel-Tower_p=Tower
|
||||||
|
|
||||||
|
[King of the Hill]
|
||||||
|
AOCKOTH-Arena3_p=Arena
|
||||||
|
AOCKOTH-Hillside_P=Hillside
|
||||||
|
AOCKOTH-Moor_p=Moor
|
||||||
|
AOCKOTH-Darkforest_Valley_p=Dark forest Valley
|
||||||
|
|
||||||
|
[Last Team Standing]
|
||||||
|
AOCLTS-Frigid_p=Frigid
|
||||||
|
AOCLTS-ArgonsWall_p=Argons Wall
|
||||||
|
AOCLTS-Arena3_p=Arena
|
||||||
|
AOCLTS-Battlegrounds_Farm_p=Battlegrounds Farm
|
||||||
|
AOCLTS-Battlegrounds_p=Battlegrounds
|
||||||
|
AOCLTS-Darkforest_XL_p=Dark forest
|
||||||
|
AOCLTS-Darkforest_Valley_p=Dark forest Valley
|
||||||
|
AOCLTS-Hillside_P=Hillside
|
||||||
|
AOCLTS-HillsidePyre_P=Hillside Pyre
|
||||||
|
AOCLTS-Moor_p=Moor
|
||||||
|
AOCLTS-Moor_Large_p=Moor Large
|
||||||
|
AOCLTS-Ruins_P=Ruins
|
||||||
|
AOCLTS-Ruins_Large_P=Ruins Large
|
||||||
|
AOCLTS-StoneshillVillage_P=Stoneshill Village
|
||||||
|
AOCLTS-ThroneRoom_P=Throne Room
|
||||||
|
|
||||||
|
[Free for All]
|
||||||
|
AOCFFA-Arena3_p=Arena
|
||||||
|
AOCFFA-Darkforest_Cistern_p=Dark forest Cistern
|
||||||
|
AOCFFA-Darkforest_Valley_p=Dark forest Valley
|
||||||
|
AOCFFA-HillsidePyre_P=Hillside Pyre
|
||||||
|
AOCFFA-Hillside_P=Hillside
|
||||||
|
AOCFFA-Moor_p=Moor
|
||||||
|
AOCFFA-Ruins_P=Ruins
|
||||||
|
AOCFFA-ThroneRoomXL_P=Throne Room XL
|
||||||
|
AOCFFA-StoneshillVillage_P=Stoneshill Village
|
||||||
|
|
||||||
|
[Team Deathmatch]
|
||||||
|
AOCTD-Frigid_p=Frigid
|
||||||
|
AOCTD-ArgonsWall_p=Argons Wall
|
||||||
|
AOCTD-Ruins_P=Ruins
|
||||||
|
AOCTD-ThroneRoom_P=Throne Room
|
||||||
|
AOCTD-StoneshillVillage_P=Stoneshill Village
|
||||||
|
AOCTD-Moor_p=Moor
|
||||||
|
AOCTD-Battlegrounds_Farm_p=Battlegrounds Farm
|
||||||
|
AOCTD-Battlegrounds_p=Battlegrounds
|
||||||
|
AOCTD-Hillside_P=Hillside
|
||||||
|
AOCTD-HillsidePyre_P=Hillside Pyre
|
||||||
|
AOCTD-Darkforest_XL_p=Dark forest XL
|
||||||
|
AOCTD-Darkforest_Valley_p=Dark forest Valley
|
||||||
|
AOCTD-Moor_Large_p=Moor Large
|
||||||
|
AOCTD-Ruins_Large_P=Ruins Large
|
23
license.txt
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
Chivalry Server Launcher is released under the zlib/libpng OSI-approved license.
|
||||||
|
For more information: http://www.opensource.org/
|
||||||
|
|
||||||
|
Copyright (c) 2014 X2Software
|
||||||
|
http://www.x2software.net/
|
||||||
|
|
||||||
|
This software is provided 'as-is', without any express or implied warranty.
|
||||||
|
In no event will the authors be held liable for any damages arising from
|
||||||
|
the use of this software.
|
||||||
|
|
||||||
|
Permission is granted to anyone to use this software for any purpose,
|
||||||
|
including commercial applications, and to alter it and redistribute it
|
||||||
|
freely, subject to the following restrictions:
|
||||||
|
|
||||||
|
1. The origin of this software must not be misrepresented; you must not
|
||||||
|
claim that you wrote the original software. If you use this software in a
|
||||||
|
product, an acknowledgment in the product documentation would be
|
||||||
|
appreciated but is not required.
|
||||||
|
|
||||||
|
2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
misrepresented as being the original software.
|
||||||
|
|
||||||
|
3. This notice may not be removed or altered from any source distribution.
|
19
readme.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Built using Embarcadero Delphi XE2
|
||||||
|
|
||||||
|
|
||||||
|
Required components:
|
||||||
|
|
||||||
|
JEDI Code Library (JCL) and Visual Component Library (JVCL)
|
||||||
|
http://www.delphi-jedi.org/
|
||||||
|
|
||||||
|
SuperObject
|
||||||
|
https://code.google.com/p/superobject/
|
||||||
|
|
||||||
|
Virtual Treeview
|
||||||
|
http://www.soft-gems.net/index.php/controls/virtual-treeview
|
||||||
|
|
||||||
|
X² Component Library
|
||||||
|
http://svn.x2software.net/wsvn/x2cl
|
||||||
|
|
||||||
|
X² Utils
|
||||||
|
http://svn.x2software.net/wsvn/x2utils
|
BIN
resources/icons/MainIcon.ico
Normal file
After Width: | Height: | Size: 97 KiB |
BIN
resources/images/chiv_logoshadow.png
Normal file
After Width: | Height: | Size: 547 KiB |
BIN
resources/images/chiv_logoshadow_75.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
resources/images/menu/About.png
Normal file
After Width: | Height: | Size: 721 B |
BIN
resources/images/menu/Games.png
Normal file
After Width: | Height: | Size: 931 B |
BIN
resources/images/menu/Maplist.png
Normal file
After Width: | Height: | Size: 955 B |
BIN
resources/images/menu/Network.png
Normal file
After Width: | Height: | Size: 934 B |
BIN
resources/images/menu/Settings.png
Normal file
After Width: | Height: | Size: 929 B |
BIN
resources/images/toolbar/add.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
resources/images/toolbar/remove.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
resources/images/warning.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
20
source/Resources.pas
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
unit Resources;
|
||||||
|
|
||||||
|
interface
|
||||||
|
const
|
||||||
|
AssetsPath = 'assets\';
|
||||||
|
|
||||||
|
|
||||||
|
function GetAssetPath(const AAsset: string): string;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
X2UtApp;
|
||||||
|
|
||||||
|
|
||||||
|
function GetAssetPath(const AAsset: string): string;
|
||||||
|
begin
|
||||||
|
Result := App.Path + AssetsPath + AAsset;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
42
source/bindings/Bindings.Converters.pas
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
unit Bindings.Converters;
|
||||||
|
|
||||||
|
interface
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
System.Bindings.Outputs,
|
||||||
|
System.Rtti;
|
||||||
|
|
||||||
|
|
||||||
|
const
|
||||||
|
IntToExtended = 'IntToExtended';
|
||||||
|
ExtendedToInt = 'ExtendedToInt';
|
||||||
|
|
||||||
|
|
||||||
|
procedure RegisterConverters;
|
||||||
|
begin
|
||||||
|
TValueRefConverterFactory.RegisterConversion([TypeInfo(Integer)], [TypeInfo(Extended)],
|
||||||
|
TConverterDescription.Create(
|
||||||
|
procedure(const I: TValue; var O: TValue)
|
||||||
|
begin
|
||||||
|
O := TValue.From<Extended>(I.AsInteger);
|
||||||
|
end,
|
||||||
|
|
||||||
|
IntToExtended, IntToExtended, '', True, '', nil)
|
||||||
|
);
|
||||||
|
|
||||||
|
TValueRefConverterFactory.RegisterConversion([TypeInfo(Extended)], [TypeInfo(Integer)],
|
||||||
|
TConverterDescription.Create(
|
||||||
|
procedure(const I: TValue; var O: TValue)
|
||||||
|
begin
|
||||||
|
O := TValue.From<Integer>(Trunc(I.AsExtended));
|
||||||
|
end,
|
||||||
|
|
||||||
|
ExtendedToInt, ExtendedToInt, '', True, '', nil)
|
||||||
|
);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
initialization
|
||||||
|
RegisterConverters;
|
||||||
|
|
||||||
|
end.
|
48
source/model/Game.Base.pas
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
unit Game.Base;
|
||||||
|
|
||||||
|
interface
|
||||||
|
uses
|
||||||
|
System.Classes;
|
||||||
|
|
||||||
|
|
||||||
|
type
|
||||||
|
TCustomGame = class(TInterfacedPersistent)
|
||||||
|
private
|
||||||
|
FLocation: string;
|
||||||
|
protected
|
||||||
|
procedure Notify(const APropertyName: string); virtual;
|
||||||
|
public
|
||||||
|
class function GetGameName: string; virtual; abstract;
|
||||||
|
|
||||||
|
constructor Create(const ALocation: string); virtual;
|
||||||
|
|
||||||
|
procedure Load; virtual; abstract;
|
||||||
|
procedure Save; virtual; abstract;
|
||||||
|
|
||||||
|
property Location: string read FLocation;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TCustomGameClass = class of TCustomGame;
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
System.Bindings.Helper,
|
||||||
|
System.SysUtils;
|
||||||
|
|
||||||
|
|
||||||
|
{ TCustomGame }
|
||||||
|
constructor TCustomGame.Create(const ALocation: string);
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
|
||||||
|
FLocation := IncludeTrailingPathDelimiter(ALocation);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TCustomGame.Notify(const APropertyName: string);
|
||||||
|
begin
|
||||||
|
TBindings.Notify(Self, APropertyName);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
88
source/model/Game.Chivalry.MedievalWarfare.pas
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
unit Game.Chivalry.MedievalWarfare;
|
||||||
|
|
||||||
|
interface
|
||||||
|
uses
|
||||||
|
System.Generics.Collections,
|
||||||
|
|
||||||
|
Game.Chivalry,
|
||||||
|
Game.Intf;
|
||||||
|
|
||||||
|
|
||||||
|
type
|
||||||
|
{ I haven't actually done any research into the dedicated server
|
||||||
|
for the other Chivalry game, so for now most stuff is implemented
|
||||||
|
in the base Chivalry class. }
|
||||||
|
TChivalryMedievalWarfareGame = class(TChivalryGame)
|
||||||
|
protected
|
||||||
|
procedure LoadSupportedMapList(AList: TList<IGameMap>); override;
|
||||||
|
public
|
||||||
|
class function GetGameName: string; override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
System.Classes,
|
||||||
|
System.IniFiles,
|
||||||
|
System.SysUtils,
|
||||||
|
|
||||||
|
Resources,
|
||||||
|
Game.Map,
|
||||||
|
Game.Registry;
|
||||||
|
|
||||||
|
|
||||||
|
{ TChivalryMedievalWarfareGame }
|
||||||
|
class function TChivalryMedievalWarfareGame.GetGameName: string;
|
||||||
|
begin
|
||||||
|
Result := 'Chivalry: Medieval Warfare';
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TChivalryMedievalWarfareGame.LoadSupportedMapList(AList: TList<IGameMap>);
|
||||||
|
var
|
||||||
|
mapListFileName: string;
|
||||||
|
mapList: TMemIniFile;
|
||||||
|
categories: TStringList;
|
||||||
|
categoryName: string;
|
||||||
|
maps: TStringList;
|
||||||
|
mapIndex: Integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
mapListFileName := GetAssetPath('Chivalry.MedievalWarfare.MapList.ini');
|
||||||
|
if not FileExists(mapListFileName) then
|
||||||
|
exit;
|
||||||
|
|
||||||
|
mapList := TMemIniFile.Create(mapListFileName);
|
||||||
|
try
|
||||||
|
categories := nil;
|
||||||
|
maps := nil;
|
||||||
|
try
|
||||||
|
categories := TStringList.Create;
|
||||||
|
maps := TStringList.Create;
|
||||||
|
|
||||||
|
mapList.ReadSections(categories);
|
||||||
|
|
||||||
|
for categoryName in categories do
|
||||||
|
begin
|
||||||
|
maps.Clear;
|
||||||
|
mapList.ReadSectionValues(categoryName, maps);
|
||||||
|
|
||||||
|
for mapIndex := 0 to Pred(maps.Count) do
|
||||||
|
AList.Add(TGameMap.Create(Trim(maps.Names[mapIndex]),
|
||||||
|
Trim(maps.ValueFromIndex[mapIndex]),
|
||||||
|
Trim(categoryName)));
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
FreeAndNil(maps);
|
||||||
|
FreeAndNil(categories);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
FreeAndNil(mapList);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
initialization
|
||||||
|
TGameRegistry.Register(TChivalryMedievalWarfareGame);
|
||||||
|
|
||||||
|
end.
|
229
source/model/Game.Chivalry.pas
Normal file
@ -0,0 +1,229 @@
|
|||||||
|
unit Game.Chivalry;
|
||||||
|
|
||||||
|
interface
|
||||||
|
uses
|
||||||
|
System.Generics.Collections,
|
||||||
|
|
||||||
|
Game.Base,
|
||||||
|
Game.Intf;
|
||||||
|
|
||||||
|
|
||||||
|
type
|
||||||
|
TChivalryGame = class(TCustomGame, IGameNetwork, IGameName, IGameMapList)
|
||||||
|
private
|
||||||
|
FServerPort: Integer;
|
||||||
|
FPeerPort: Integer;
|
||||||
|
FQueryPort: Integer;
|
||||||
|
|
||||||
|
FServerName: string;
|
||||||
|
FMessageOfTheDay: string;
|
||||||
|
|
||||||
|
FSupportedMapList: TList<IGameMap>;
|
||||||
|
FMapList: TList<string>;
|
||||||
|
protected
|
||||||
|
procedure LoadSupportedMapList(AList: TList<IGameMap>); virtual; abstract;
|
||||||
|
public
|
||||||
|
constructor Create(const ALocation: string); override;
|
||||||
|
destructor Destroy; override;
|
||||||
|
|
||||||
|
procedure Load; override;
|
||||||
|
procedure Save; override;
|
||||||
|
|
||||||
|
{ IGameNetwork }
|
||||||
|
function GetServerPort: Integer;
|
||||||
|
function GetPeerPort: Integer;
|
||||||
|
function GetQueryPort: Integer;
|
||||||
|
|
||||||
|
procedure SetServerPort(const Value: Integer);
|
||||||
|
procedure SetPeerPort(const Value: Integer);
|
||||||
|
procedure SetQueryPort(const Value: Integer);
|
||||||
|
|
||||||
|
property ServerPort: Integer read GetServerPort write SetServerPort;
|
||||||
|
property PeerPort: Integer read GetPeerPort write SetPeerPort;
|
||||||
|
property QueryPort: Integer read GetQueryPort write SetQueryPort;
|
||||||
|
|
||||||
|
{ IGameName }
|
||||||
|
function GetServerName: string;
|
||||||
|
function GetMessageOfTheDay: string;
|
||||||
|
|
||||||
|
procedure SetServerName(const Value: string);
|
||||||
|
procedure SetMessageOfTheDay(const Value: string);
|
||||||
|
|
||||||
|
property ServerName: string read GetServerName write SetServerName;
|
||||||
|
property MessageOfTheDay: string read GetMessageOfTheDay write SetMessageOfTheDay;
|
||||||
|
|
||||||
|
{ IGameMapList }
|
||||||
|
function GetMapList: System.Generics.Collections.TList<System.string>;
|
||||||
|
function GetSupportedMapList: System.Generics.Collections.TList<Game.Intf.IGameMap>;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
System.IniFiles,
|
||||||
|
System.SysUtils;
|
||||||
|
|
||||||
|
|
||||||
|
const
|
||||||
|
GameSettingsFileName = 'UDKGame\Config\PCServer-UDKGame.ini';
|
||||||
|
GameURL = 'URL';
|
||||||
|
GameURLPort = 'Port'; GameURLPortDefault = 7777;
|
||||||
|
GameURLPeerPort = 'PeerPort'; GameURLPeerPortDefault = 7778;
|
||||||
|
|
||||||
|
GameReplicationInfo = 'Engine.GameReplicationInfo';
|
||||||
|
GameReplicationInfoServerName = 'ServerName';
|
||||||
|
GameReplicationInfoMessageOfTheDay = 'MessageOfTheDay';
|
||||||
|
|
||||||
|
|
||||||
|
EngineSettingsFileName = 'UDKGame\Config\PCServer-UDKEngine.ini';
|
||||||
|
EngineSteam = 'OnlineSubsystemSteamworks.OnlineSubsystemSteamworks';
|
||||||
|
EngineSteamQueryPort = 'QueryPort'; EngineSteamQueryPortDefault = 27015;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{ TChivalryGame }
|
||||||
|
constructor TChivalryGame.Create(const ALocation: string);
|
||||||
|
begin
|
||||||
|
inherited Create(ALocation);
|
||||||
|
|
||||||
|
FSupportedMapList := TList<IGameMap>.Create;
|
||||||
|
FMapList := TList<string>.Create;
|
||||||
|
|
||||||
|
LoadSupportedMapList(FSupportedMapList);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
destructor TChivalryGame.Destroy;
|
||||||
|
begin
|
||||||
|
FreeAndNil(FMapList);
|
||||||
|
FreeAndNil(FSupportedMapList);
|
||||||
|
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TChivalryGame.Load;
|
||||||
|
var
|
||||||
|
gameSettings: TMemIniFile;
|
||||||
|
engineSettings: TMemIniFile;
|
||||||
|
|
||||||
|
begin
|
||||||
|
gameSettings := TMemIniFile.Create(Location + GameSettingsFileName);
|
||||||
|
try
|
||||||
|
FServerPort := gameSettings.ReadInteger(GameURL, GameURLPort, GameURLPortDefault);
|
||||||
|
FPeerPort := gameSettings.ReadInteger(GameURL, GameURLPeerPort, GameURLPeerPortDefault);
|
||||||
|
|
||||||
|
FServerName := gameSettings.ReadString(GameReplicationInfo, GameReplicationInfoServerName, '');
|
||||||
|
FMessageOfTheDay := gameSettings.ReadString(GameReplicationInfo, GameReplicationInfoMessageOfTheDay, '');
|
||||||
|
finally
|
||||||
|
FreeAndNil(gameSettings);
|
||||||
|
end;
|
||||||
|
|
||||||
|
engineSettings := TMemIniFile.Create(Location + EngineSettingsFileName);
|
||||||
|
try
|
||||||
|
FQueryPort := engineSettings.ReadInteger(EngineSteam, EngineSteamQueryPort, EngineSteamQueryPortDefault);
|
||||||
|
finally
|
||||||
|
FreeAndNil(engineSettings);
|
||||||
|
end;
|
||||||
|
|
||||||
|
// #ToDo1 -oMvR: 30-6-2014: load map list
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TChivalryGame.Save;
|
||||||
|
begin
|
||||||
|
// #ToDo1 -oMvR: 30-6-2014: save to INI files
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TChivalryGame.GetServerPort: Integer;
|
||||||
|
begin
|
||||||
|
Result := FServerPort;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TChivalryGame.GetPeerPort: Integer;
|
||||||
|
begin
|
||||||
|
Result := FPeerPort;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TChivalryGame.GetQueryPort: Integer;
|
||||||
|
begin
|
||||||
|
Result := FQueryPort;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TChivalryGame.SetServerPort(const Value: Integer);
|
||||||
|
begin
|
||||||
|
if Value <> FServerPort then
|
||||||
|
begin
|
||||||
|
FServerPort := Value;
|
||||||
|
Notify('ServerPort');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TChivalryGame.SetPeerPort(const Value: Integer);
|
||||||
|
begin
|
||||||
|
if Value <> FPeerPort then
|
||||||
|
begin
|
||||||
|
FPeerPort := Value;
|
||||||
|
Notify('PeerPort');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TChivalryGame.SetQueryPort(const Value: Integer);
|
||||||
|
begin
|
||||||
|
if Value <> FQueryPort then
|
||||||
|
begin
|
||||||
|
FQueryPort := Value;
|
||||||
|
Notify('QueryPort');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TChivalryGame.GetServerName: string;
|
||||||
|
begin
|
||||||
|
Result := FServerName;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TChivalryGame.GetMessageOfTheDay: string;
|
||||||
|
begin
|
||||||
|
Result := FMessageOfTheDay;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TChivalryGame.SetServerName(const Value: string);
|
||||||
|
begin
|
||||||
|
if Value <> FServerName then
|
||||||
|
begin
|
||||||
|
FServerName := Value;
|
||||||
|
Notify('ServerName');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TChivalryGame.SetMessageOfTheDay(const Value: string);
|
||||||
|
begin
|
||||||
|
if Value <> FMessageOfTheDay then
|
||||||
|
begin
|
||||||
|
FMessageOfTheDay := Value;
|
||||||
|
Notify('MessageOfTheDay');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TChivalryGame.GetMapList: System.Generics.Collections.TList<System.string>;
|
||||||
|
begin
|
||||||
|
Result := FMapList;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TChivalryGame.GetSupportedMapList: System.Generics.Collections.TList<Game.Intf.IGameMap>;
|
||||||
|
begin
|
||||||
|
Result := FSupportedMapList;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
59
source/model/Game.Intf.pas
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
unit Game.Intf;
|
||||||
|
|
||||||
|
interface
|
||||||
|
uses
|
||||||
|
System.Generics.Collections;
|
||||||
|
|
||||||
|
|
||||||
|
type
|
||||||
|
IGameNetwork = interface
|
||||||
|
['{0B1445D2-E6B7-45FD-98CB-A76F01B9D4B8}']
|
||||||
|
function GetServerPort: Integer;
|
||||||
|
function GetPeerPort: Integer;
|
||||||
|
function GetQueryPort: Integer;
|
||||||
|
|
||||||
|
procedure SetServerPort(const Value: Integer);
|
||||||
|
procedure SetPeerPort(const Value: Integer);
|
||||||
|
procedure SetQueryPort(const Value: Integer);
|
||||||
|
|
||||||
|
property ServerPort: Integer read GetServerPort write SetServerPort;
|
||||||
|
property PeerPort: Integer read GetPeerPort write SetPeerPort;
|
||||||
|
property QueryPort: Integer read GetQueryPort write SetQueryPort;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
IGameName = interface
|
||||||
|
['{44A04A0D-BE01-42B7-8EF1-7EC5CC431B66}']
|
||||||
|
function GetServerName: string;
|
||||||
|
function GetMessageOfTheDay: string;
|
||||||
|
|
||||||
|
procedure SetServerName(const Value: string);
|
||||||
|
procedure SetMessageOfTheDay(const Value: string);
|
||||||
|
|
||||||
|
property ServerName: string read GetServerName write SetServerName;
|
||||||
|
property MessageOfTheDay: string read GetMessageOfTheDay write SetMessageOfTheDay;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
IGameMap = interface
|
||||||
|
['{B50A090C-3731-401F-91B5-0895CBE99921}']
|
||||||
|
function GetCategory: string;
|
||||||
|
function GetName: string;
|
||||||
|
function GetDisplayName: string;
|
||||||
|
|
||||||
|
property Category: string read GetCategory;
|
||||||
|
property Name: string read GetName;
|
||||||
|
property DisplayName: string read GetDisplayName;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
IGameMapList = interface
|
||||||
|
['{E8552B4C-9447-4FAD-BB20-C5EB3AF07B0E}']
|
||||||
|
function GetSupportedMapList: TList<IGameMap>;
|
||||||
|
function GetMapList: TList<string>;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
end.
|
46
source/model/Game.List.pas
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
unit Game.List;
|
||||||
|
|
||||||
|
interface
|
||||||
|
uses
|
||||||
|
System.Generics.Collections,
|
||||||
|
|
||||||
|
Game.Base;
|
||||||
|
|
||||||
|
|
||||||
|
type
|
||||||
|
TGameList = class(TList<TCustomGame>)
|
||||||
|
private
|
||||||
|
class var SInstance: TGameList;
|
||||||
|
protected
|
||||||
|
class procedure Finalize;
|
||||||
|
public
|
||||||
|
class function Instance: TGameList;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
System.SysUtils;
|
||||||
|
|
||||||
|
|
||||||
|
{ TGameList }
|
||||||
|
class procedure TGameList.Finalize;
|
||||||
|
begin
|
||||||
|
FreeAndNil(SInstance);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
class function TGameList.Instance: TGameList;
|
||||||
|
begin
|
||||||
|
if not Assigned(SInstance) then
|
||||||
|
SInstance := TGameList.Create;
|
||||||
|
|
||||||
|
Result := SInstance;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
initialization
|
||||||
|
finalization
|
||||||
|
TGameList.Finalize;
|
||||||
|
|
||||||
|
end.
|
57
source/model/Game.Map.pas
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
unit Game.Map;
|
||||||
|
|
||||||
|
interface
|
||||||
|
uses
|
||||||
|
Game.Intf;
|
||||||
|
|
||||||
|
|
||||||
|
type
|
||||||
|
TGameMap = class(TInterfacedObject, IGameMap)
|
||||||
|
private
|
||||||
|
FCategory: string;
|
||||||
|
FName: string;
|
||||||
|
FDisplayName: string;
|
||||||
|
public
|
||||||
|
constructor Create(const AName: string; const ADisplayName, ACategory: string);
|
||||||
|
|
||||||
|
{ IGameMap }
|
||||||
|
function GetCategory: string;
|
||||||
|
function GetName: string;
|
||||||
|
function GetDisplayName: string;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
System.StrUtils;
|
||||||
|
|
||||||
|
|
||||||
|
{ TGameMap }
|
||||||
|
constructor TGameMap.Create(const AName, ADisplayName, ACategory: string);
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
|
||||||
|
FName := AName;
|
||||||
|
FDisplayName := IfThen(Length(ADisplayName) > 0, ADisplayName, AName);
|
||||||
|
FCategory := ACategory;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TGameMap.GetCategory: string;
|
||||||
|
begin
|
||||||
|
Result := FCategory;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TGameMap.GetName: string;
|
||||||
|
begin
|
||||||
|
Result := FName;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TGameMap.GetDisplayName: string;
|
||||||
|
begin
|
||||||
|
Result := FDisplayName;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
81
source/model/Game.Registry.pas
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
unit Game.Registry;
|
||||||
|
|
||||||
|
interface
|
||||||
|
uses
|
||||||
|
System.Generics.Collections,
|
||||||
|
|
||||||
|
Game.Base;
|
||||||
|
|
||||||
|
type
|
||||||
|
TGameRegistryEnumerable = class(TObject)
|
||||||
|
public
|
||||||
|
function GetEnumerator: TEnumerator<TCustomGameClass>;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
TGameRegistry = class(TObject)
|
||||||
|
protected
|
||||||
|
class var SRegisteredGames: TList<TCustomGameClass>;
|
||||||
|
class var SEnumerable: TGameRegistryEnumerable;
|
||||||
|
|
||||||
|
class procedure Initialize;
|
||||||
|
class procedure Finalize;
|
||||||
|
public
|
||||||
|
class function RegisteredGames: TGameRegistryEnumerable;
|
||||||
|
|
||||||
|
class procedure Register(AGameClass: TCustomGameClass);
|
||||||
|
class procedure Unregister(AGameClass: TCustomGameClass);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
System.SysUtils;
|
||||||
|
|
||||||
|
|
||||||
|
{ TGameRegistry }
|
||||||
|
class procedure TGameRegistry.Initialize;
|
||||||
|
begin
|
||||||
|
SRegisteredGames := TList<TCustomGameClass>.Create;
|
||||||
|
SEnumerable := TGameRegistryEnumerable.Create;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
class procedure TGameRegistry.Finalize;
|
||||||
|
begin
|
||||||
|
FreeAndNil(SEnumerable);
|
||||||
|
FreeAndNil(SRegisteredGames);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
class function TGameRegistry.RegisteredGames: TGameRegistryEnumerable;
|
||||||
|
begin
|
||||||
|
Result := SEnumerable;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
class procedure TGameRegistry.Register(AGameClass: TCustomGameClass);
|
||||||
|
begin
|
||||||
|
if not SRegisteredGames.Contains(AGameClass) then
|
||||||
|
SRegisteredGames.Add(AGameClass);
|
||||||
|
end;
|
||||||
|
|
||||||
|
class procedure TGameRegistry.Unregister(AGameClass: TCustomGameClass);
|
||||||
|
begin
|
||||||
|
SRegisteredGames.Remove(AGameClass);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ TGameRegistryEnumerable }
|
||||||
|
function TGameRegistryEnumerable.GetEnumerator: TEnumerator<TCustomGameClass>;
|
||||||
|
begin
|
||||||
|
Result := TGameRegistry.SRegisteredGames.GetEnumerator;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
TGameRegistry.Initialize;
|
||||||
|
|
||||||
|
finalization
|
||||||
|
TGameRegistry.Finalize;
|
||||||
|
|
||||||
|
end.
|
27
source/persist/Persist.GameList.pas
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
unit Persist.GameList;
|
||||||
|
|
||||||
|
interface
|
||||||
|
uses
|
||||||
|
Game.List;
|
||||||
|
|
||||||
|
|
||||||
|
type
|
||||||
|
TGameListPersist = class(TObject)
|
||||||
|
public
|
||||||
|
class procedure Load(const AFileName: string; AList: TGameList);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
System.SysUtils;
|
||||||
|
|
||||||
|
|
||||||
|
{ TGameListPersist }
|
||||||
|
class procedure TGameListPersist.Load(const AFileName: string; AList: TGameList);
|
||||||
|
begin
|
||||||
|
if not FileExists(AFileName) then
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
121
source/view/Forms.Game.dfm
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
object GameForm: TGameForm
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
ActiveControl = deLocation
|
||||||
|
BorderIcons = [biSystemMenu]
|
||||||
|
BorderStyle = bsDialog
|
||||||
|
Caption = 'Game location'
|
||||||
|
ClientHeight = 124
|
||||||
|
ClientWidth = 519
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = DEFAULT_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'Tahoma'
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
Position = poOwnerFormCenter
|
||||||
|
OnCreate = FormCreate
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 13
|
||||||
|
object gbGame: TGroupBox
|
||||||
|
AlignWithMargins = True
|
||||||
|
Left = 8
|
||||||
|
Top = 8
|
||||||
|
Width = 503
|
||||||
|
Height = 75
|
||||||
|
Margins.Left = 8
|
||||||
|
Margins.Top = 8
|
||||||
|
Margins.Right = 8
|
||||||
|
Margins.Bottom = 8
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 0
|
||||||
|
ExplicitLeft = 232
|
||||||
|
ExplicitTop = 136
|
||||||
|
ExplicitWidth = 185
|
||||||
|
ExplicitHeight = 105
|
||||||
|
DesignSize = (
|
||||||
|
503
|
||||||
|
75)
|
||||||
|
object lblGame: TLabel
|
||||||
|
Left = 20
|
||||||
|
Top = 15
|
||||||
|
Width = 31
|
||||||
|
Height = 13
|
||||||
|
Caption = 'Game:'
|
||||||
|
end
|
||||||
|
object lblLocation: TLabel
|
||||||
|
Left = 20
|
||||||
|
Top = 42
|
||||||
|
Width = 44
|
||||||
|
Height = 13
|
||||||
|
Caption = 'Location:'
|
||||||
|
end
|
||||||
|
object cmbGame: TComboBox
|
||||||
|
Left = 108
|
||||||
|
Top = 12
|
||||||
|
Width = 383
|
||||||
|
Height = 21
|
||||||
|
Style = csDropDownList
|
||||||
|
Anchors = [akLeft, akTop, akRight]
|
||||||
|
TabOrder = 0
|
||||||
|
ExplicitWidth = 509
|
||||||
|
end
|
||||||
|
object deLocation: TJvDirectoryEdit
|
||||||
|
Left = 108
|
||||||
|
Top = 39
|
||||||
|
Width = 383
|
||||||
|
Height = 21
|
||||||
|
DialogKind = dkWin32
|
||||||
|
DialogText = 'Select game location'
|
||||||
|
DialogOptionsWin32 = [odStatusAvailable, odEditBox, odNewDialogStyle, odNoNewButtonFolder]
|
||||||
|
Anchors = [akLeft, akTop, akRight]
|
||||||
|
TabOrder = 1
|
||||||
|
ExplicitWidth = 509
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object pnlButtons: TPanel
|
||||||
|
AlignWithMargins = True
|
||||||
|
Left = 8
|
||||||
|
Top = 91
|
||||||
|
Width = 503
|
||||||
|
Height = 25
|
||||||
|
Margins.Left = 8
|
||||||
|
Margins.Top = 0
|
||||||
|
Margins.Right = 8
|
||||||
|
Margins.Bottom = 8
|
||||||
|
Align = alBottom
|
||||||
|
AutoSize = True
|
||||||
|
BevelOuter = bvNone
|
||||||
|
TabOrder = 1
|
||||||
|
object btnCancel: TButton
|
||||||
|
Left = 428
|
||||||
|
Top = 0
|
||||||
|
Width = 75
|
||||||
|
Height = 25
|
||||||
|
Align = alRight
|
||||||
|
Cancel = True
|
||||||
|
Caption = 'Cancel'
|
||||||
|
ModalResult = 2
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object btnOK: TButton
|
||||||
|
AlignWithMargins = True
|
||||||
|
Left = 345
|
||||||
|
Top = 0
|
||||||
|
Width = 75
|
||||||
|
Height = 25
|
||||||
|
Margins.Left = 0
|
||||||
|
Margins.Top = 0
|
||||||
|
Margins.Right = 8
|
||||||
|
Margins.Bottom = 0
|
||||||
|
Align = alRight
|
||||||
|
Caption = 'OK'
|
||||||
|
Default = True
|
||||||
|
TabOrder = 0
|
||||||
|
OnClick = btnOKClick
|
||||||
|
ExplicitLeft = 347
|
||||||
|
ExplicitTop = 3
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
133
source/view/Forms.Game.pas
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
unit Forms.Game;
|
||||||
|
|
||||||
|
interface
|
||||||
|
uses
|
||||||
|
System.Classes,
|
||||||
|
Vcl.Controls,
|
||||||
|
Vcl.Dialogs,
|
||||||
|
Vcl.ExtCtrls,
|
||||||
|
Vcl.Forms,
|
||||||
|
Vcl.Mask,
|
||||||
|
Vcl.StdCtrls,
|
||||||
|
|
||||||
|
JvExMask,
|
||||||
|
JvToolEdit,
|
||||||
|
|
||||||
|
Game.Base;
|
||||||
|
|
||||||
|
|
||||||
|
type
|
||||||
|
TGameForm = class(TForm)
|
||||||
|
btnCancel: TButton;
|
||||||
|
btnOK: TButton;
|
||||||
|
cmbGame: TComboBox;
|
||||||
|
deLocation: TJvDirectoryEdit;
|
||||||
|
gbGame: TGroupBox;
|
||||||
|
lblGame: TLabel;
|
||||||
|
lblLocation: TLabel;
|
||||||
|
pnlButtons: TPanel;
|
||||||
|
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure btnOKClick(Sender: TObject);
|
||||||
|
private
|
||||||
|
function GetGameClass: TCustomGameClass;
|
||||||
|
function GetLocation: string;
|
||||||
|
procedure SetGameClass(const Value: TCustomGameClass);
|
||||||
|
procedure SetLocation(const Value: string);
|
||||||
|
protected
|
||||||
|
property GameClass: TCustomGameClass read GetGameClass write SetGameClass;
|
||||||
|
property Location: string read GetLocation write SetLocation;
|
||||||
|
public
|
||||||
|
class function Insert(AOwner: TComponent; out AGame: TCustomGame): Boolean;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
System.SysUtils,
|
||||||
|
Winapi.Windows,
|
||||||
|
|
||||||
|
Game.Registry;
|
||||||
|
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
|
||||||
|
{ TGameForm }
|
||||||
|
class function TGameForm.Insert(AOwner: TComponent; out AGame: TCustomGame): Boolean;
|
||||||
|
begin
|
||||||
|
with Self.Create(AOwner) do
|
||||||
|
try
|
||||||
|
Result := (ShowModal = mrOk);
|
||||||
|
if Result then
|
||||||
|
AGame := GameClass.Create(Location);
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TGameForm.FormCreate(Sender: TObject);
|
||||||
|
var
|
||||||
|
gameClass: TCustomGameClass;
|
||||||
|
|
||||||
|
begin
|
||||||
|
cmbGame.Items.BeginUpdate;
|
||||||
|
try
|
||||||
|
cmbGame.Items.Clear;
|
||||||
|
|
||||||
|
for gameClass in TGameRegistry.RegisteredGames do
|
||||||
|
cmbGame.Items.AddObject(gameClass.GetGameName, TObject(gameClass));
|
||||||
|
finally
|
||||||
|
cmbGame.Items.EndUpdate;
|
||||||
|
cmbGame.ItemIndex := 0;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TGameForm.btnOKClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if not Assigned(GameClass) then
|
||||||
|
begin
|
||||||
|
MessageBox(Self.Handle, 'Please select the game type', 'Error', MB_OK or MB_ICONERROR);
|
||||||
|
ActiveControl := cmbGame;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if (Length(Location) = 0) or (not DirectoryExists(Location)) then
|
||||||
|
begin
|
||||||
|
MessageBox(Self.Handle, 'Please enter a valid location', 'Error', MB_OK or MB_ICONERROR);
|
||||||
|
ActiveControl := deLocation;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
ModalResult := mrOk;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TGameForm.GetGameClass: TCustomGameClass;
|
||||||
|
begin
|
||||||
|
Result := nil;
|
||||||
|
if cmbGame.ItemIndex > -1 then
|
||||||
|
Result := TCustomGameClass(cmbGame.Items.Objects[cmbGame.ItemIndex]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TGameForm.GetLocation: string;
|
||||||
|
begin
|
||||||
|
Result := deLocation.Text;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TGameForm.SetGameClass(const Value: TCustomGameClass);
|
||||||
|
begin
|
||||||
|
cmbGame.ItemIndex := cmbGame.Items.IndexOfObject(TObject(Value));
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TGameForm.SetLocation(const Value: string);
|
||||||
|
begin
|
||||||
|
deLocation.Text := Value;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
1893
source/view/Forms.Main.dfm
Normal file
502
source/view/Forms.Main.pas
Normal file
@ -0,0 +1,502 @@
|
|||||||
|
unit Forms.Main;
|
||||||
|
|
||||||
|
interface
|
||||||
|
uses
|
||||||
|
System.Bindings.Expression,
|
||||||
|
System.Classes,
|
||||||
|
System.Generics.Collections,
|
||||||
|
Vcl.ComCtrls,
|
||||||
|
Vcl.Controls,
|
||||||
|
Vcl.ExtCtrls,
|
||||||
|
Vcl.Forms,
|
||||||
|
Vcl.Imaging.pngimage,
|
||||||
|
Vcl.ImgList,
|
||||||
|
Vcl.Mask,
|
||||||
|
Vcl.StdCtrls,
|
||||||
|
Vcl.ToolWin,
|
||||||
|
|
||||||
|
JvExControls,
|
||||||
|
JvExMask,
|
||||||
|
JvGradient,
|
||||||
|
JvGroupHeader,
|
||||||
|
JvSpin,
|
||||||
|
VirtualTrees,
|
||||||
|
X2CLGraphicList,
|
||||||
|
X2CLMenuBar,
|
||||||
|
X2CLmusikCubeMenuBarPainter,
|
||||||
|
|
||||||
|
Game.Base,
|
||||||
|
Game.Intf, Vcl.ActnList;
|
||||||
|
|
||||||
|
|
||||||
|
type
|
||||||
|
TMainForm = class(TForm)
|
||||||
|
edtMessageOfTheDay: TEdit;
|
||||||
|
edtServerName: TEdit;
|
||||||
|
gbPorts: TGroupBox;
|
||||||
|
gbServerName: TGroupBox;
|
||||||
|
gcMenu: TX2GraphicContainer;
|
||||||
|
gcMenuAbout: TX2GraphicContainerItem;
|
||||||
|
gcMenuGames: TX2GraphicContainerItem;
|
||||||
|
gcMenuMaplist: TX2GraphicContainerItem;
|
||||||
|
gcMenuNetwork: TX2GraphicContainerItem;
|
||||||
|
gcMenuSettings: TX2GraphicContainerItem;
|
||||||
|
gcToolbar: TX2GraphicContainer;
|
||||||
|
gcToolbaradd: TX2GraphicContainerItem;
|
||||||
|
gcToolbarremove: TX2GraphicContainerItem;
|
||||||
|
glMenu: TX2GraphicList;
|
||||||
|
glToolbar: TX2GraphicList;
|
||||||
|
grdMenu: TJvGradient;
|
||||||
|
imgGamesWarning: TImage;
|
||||||
|
imgLogo: TImage;
|
||||||
|
lblChivalry: TLabel;
|
||||||
|
lblPixelophilia: TLabel;
|
||||||
|
lblGamesWarning: TLabel;
|
||||||
|
lblGentleface: TLabel;
|
||||||
|
lblJCL: TLabel;
|
||||||
|
lblMessageOfTheDay: TLabel;
|
||||||
|
lblPeerPort: TLabel;
|
||||||
|
lblQueryPort: TLabel;
|
||||||
|
lblServerName: TLabel;
|
||||||
|
lblServerPort: TLabel;
|
||||||
|
lblVirtualTreeview: TLabel;
|
||||||
|
llChivalry: TLinkLabel;
|
||||||
|
llPixelophilia: TLinkLabel;
|
||||||
|
llGentleface: TLinkLabel;
|
||||||
|
llPixelophiliaCC: TLinkLabel;
|
||||||
|
llGentlefaceCC: TLinkLabel;
|
||||||
|
llJCL: TLinkLabel;
|
||||||
|
llVirtualTreeview: TLinkLabel;
|
||||||
|
mbMenu: TX2MenuBar;
|
||||||
|
mbpMenuPainter: TX2MenuBarmusikCubePainter;
|
||||||
|
pcMain: TPageControl;
|
||||||
|
pnlLogo: TPanel;
|
||||||
|
pnlGamesWarning: TPanel;
|
||||||
|
sePeerPort: TJvSpinEdit;
|
||||||
|
seQueryPort: TJvSpinEdit;
|
||||||
|
seServerPort: TJvSpinEdit;
|
||||||
|
shpMenu: TShape;
|
||||||
|
tbGames: TToolBar;
|
||||||
|
tbGameAdd: TToolButton;
|
||||||
|
tbGameRemove: TToolButton;
|
||||||
|
tsAbout: TTabSheet;
|
||||||
|
tsConfiguration: TTabSheet;
|
||||||
|
tsGames: TTabSheet;
|
||||||
|
tsMapList: TTabSheet;
|
||||||
|
tsNetwork: TTabSheet;
|
||||||
|
vstMapList: TVirtualStringTree;
|
||||||
|
VirtualStringTree2: TVirtualStringTree;
|
||||||
|
alMain: TActionList;
|
||||||
|
actGameAdd: TAction;
|
||||||
|
actGameRemove: TAction;
|
||||||
|
lblSuperObject: TLabel;
|
||||||
|
llSuperObject: TLinkLabel;
|
||||||
|
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure mbMenuCollapsing(Sender: TObject; Group: TX2MenuBarGroup; var Allowed: Boolean);
|
||||||
|
procedure mbMenuSelectedChanged(Sender: TObject; Item: TX2CustomMenuBarItem);
|
||||||
|
procedure llLinkClick(Sender: TObject; const Link: string; LinkType: TSysLinkType);
|
||||||
|
procedure SpinEditChange(Sender: TObject);
|
||||||
|
procedure EditChange(Sender: TObject);
|
||||||
|
procedure actGameAddExecute(Sender: TObject);
|
||||||
|
procedure actGameRemoveExecute(Sender: TObject);
|
||||||
|
private type
|
||||||
|
TBindingExpressionList = TList<TBindingExpression>;
|
||||||
|
TPageMenuMap = TDictionary<TTabSheet, TX2MenuBarItem>;
|
||||||
|
private
|
||||||
|
FActiveGame: TCustomGame;
|
||||||
|
FPageMenuMap: TPageMenuMap;
|
||||||
|
FUIBindings: TBindingExpressionList;
|
||||||
|
|
||||||
|
procedure SetActiveGame(const Value: TCustomGame);
|
||||||
|
protected
|
||||||
|
procedure ActiveGameChanged;
|
||||||
|
|
||||||
|
procedure ClearUIBindings;
|
||||||
|
procedure Bind(const APropertyName: string; ADestObject: TObject; const ADestPropertyName: string);
|
||||||
|
procedure BindGameNetwork;
|
||||||
|
procedure BindGameName;
|
||||||
|
procedure BindGameMapList;
|
||||||
|
procedure UpdateMenu;
|
||||||
|
|
||||||
|
property ActiveGame: TCustomGame read FActiveGame write SetActiveGame;
|
||||||
|
property PageMenuMap: TPageMenuMap read FPageMenuMap;
|
||||||
|
property UIBindings: TBindingExpressionList read FUIBindings;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
System.Bindings.Helper,
|
||||||
|
System.Math,
|
||||||
|
System.StrUtils,
|
||||||
|
System.SysUtils,
|
||||||
|
System.Types,
|
||||||
|
Vcl.Graphics,
|
||||||
|
Vcl.GraphUtil,
|
||||||
|
Vcl.Themes,
|
||||||
|
Winapi.ShellAPI,
|
||||||
|
Winapi.Windows,
|
||||||
|
|
||||||
|
X2UtGraphics,
|
||||||
|
|
||||||
|
Forms.Game,
|
||||||
|
Game.Chivalry.MedievalWarfare,
|
||||||
|
Game.List,
|
||||||
|
Persist.GameList;
|
||||||
|
|
||||||
|
|
||||||
|
type
|
||||||
|
TINIHintWindow = class(THintWindow)
|
||||||
|
protected
|
||||||
|
function IsINIHint(const AHint: string): Boolean;
|
||||||
|
function GetINIHint(const AHint: string; out ASection, AKey: string): Boolean;
|
||||||
|
|
||||||
|
procedure Paint; override;
|
||||||
|
public
|
||||||
|
function CalcHintRect(MaxWidth: Integer; const AHint: string; AData: Pointer): TRect; override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
const
|
||||||
|
INIHintPrefix = 'INI:';
|
||||||
|
INIHintSeparator = '>';
|
||||||
|
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
|
||||||
|
{ TMainForm }
|
||||||
|
procedure TMainForm.FormCreate(Sender: TObject);
|
||||||
|
var
|
||||||
|
lightBtnFace: TColor;
|
||||||
|
pageIndex: Integer;
|
||||||
|
menuGroup: TX2MenuBarGroup;
|
||||||
|
menuItem: TX2MenuBarItem;
|
||||||
|
// game: TCustomGame;
|
||||||
|
|
||||||
|
begin
|
||||||
|
FUIBindings := TBindingExpressionList.Create;
|
||||||
|
FPageMenuMap := TPageMenuMap.Create(pcMain.PageCount);
|
||||||
|
|
||||||
|
|
||||||
|
{ Configure pages }
|
||||||
|
for pageIndex := 0 to Pred(pcMain.PageCount) do
|
||||||
|
pcMain.Pages[pageIndex].TabVisible := False;
|
||||||
|
|
||||||
|
pageIndex := 0;
|
||||||
|
|
||||||
|
for menuGroup in mbMenu.Groups do
|
||||||
|
for menuItem in menuGroup.Items do
|
||||||
|
begin
|
||||||
|
Assert(pageIndex < pcMain.PageCount);
|
||||||
|
|
||||||
|
FPageMenuMap.Add(pcMain.Pages[pageIndex], menuItem);
|
||||||
|
menuItem.Tag := pageIndex;
|
||||||
|
Inc(pageIndex);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ Eye-candy }
|
||||||
|
lightBtnFace := BlendColors(clBtnFace, clWindow, 196);
|
||||||
|
pnlGamesWarning.Color := lightBtnFace;
|
||||||
|
|
||||||
|
// #ToDo1 -oMvR: 30-6-2014: load last active game
|
||||||
|
// game := TChivalryMedievalWarfareGame.Create('D:\Steam\steamapps\common\chivalry_ded_server');
|
||||||
|
// game.Load;
|
||||||
|
// ActiveGame := game;
|
||||||
|
|
||||||
|
|
||||||
|
{ Initialize menu }
|
||||||
|
mbpMenuPainter.GroupColors.Hot.Assign(mbpMenuPainter.GroupColors.Normal);
|
||||||
|
|
||||||
|
mbMenu.SelectFirst;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ClearUIBindings;
|
||||||
|
|
||||||
|
FreeAndNil(FPageMenuMap);
|
||||||
|
FreeAndNil(FUIBindings);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.ActiveGameChanged;
|
||||||
|
begin
|
||||||
|
ClearUIBindings;
|
||||||
|
|
||||||
|
// #ToDo1 -oMvR: 30-6-2014: attach observer to monitor changes
|
||||||
|
|
||||||
|
if Supports(ActiveGame, IGameNetwork) then
|
||||||
|
BindGameNetwork;
|
||||||
|
|
||||||
|
if Supports(ActiveGame, IGameName) then
|
||||||
|
BindGameName;
|
||||||
|
|
||||||
|
if Supports(ActiveGame, IGameMapList) then
|
||||||
|
BindGameMapList;
|
||||||
|
|
||||||
|
UpdateMenu;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.ClearUIBindings;
|
||||||
|
var
|
||||||
|
binding: TBindingExpression;
|
||||||
|
|
||||||
|
begin
|
||||||
|
for binding in UIBindings do
|
||||||
|
TBindings.RemoveBinding(binding);
|
||||||
|
|
||||||
|
UIBindings.Clear;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.Bind(const APropertyName: string; ADestObject: TObject; const ADestPropertyName: string);
|
||||||
|
begin
|
||||||
|
{ Source -> Destination }
|
||||||
|
UIBindings.Add(TBindings.CreateManagedBinding(
|
||||||
|
[TBindings.CreateAssociationScope([Associate(ActiveGame, 'src')])],
|
||||||
|
'src.' + APropertyName,
|
||||||
|
|
||||||
|
[TBindings.CreateAssociationScope([Associate(ADestObject, 'dst')])],
|
||||||
|
'dst.' + ADestPropertyName,
|
||||||
|
|
||||||
|
nil, nil, [coNotifyOutput, coEvaluate]));
|
||||||
|
|
||||||
|
{ Destination -> Source }
|
||||||
|
UIBindings.Add(TBindings.CreateManagedBinding(
|
||||||
|
[TBindings.CreateAssociationScope([Associate(ADestObject, 'src')])],
|
||||||
|
'src.' + ADestPropertyName,
|
||||||
|
|
||||||
|
[TBindings.CreateAssociationScope([Associate(ActiveGame, 'dst')])],
|
||||||
|
'dst.' + APropertyName,
|
||||||
|
|
||||||
|
nil, nil, [coNotifyOutput]));
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.BindGameNetwork;
|
||||||
|
begin
|
||||||
|
Bind('ServerPort', seServerPort, 'Value');
|
||||||
|
Bind('PeerPort', sePeerPort, 'Value');
|
||||||
|
Bind('QueryPort', seQueryPort, 'Value');
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.BindGameName;
|
||||||
|
begin
|
||||||
|
Bind('ServerName', edtServerName, 'Text');
|
||||||
|
Bind('MessageOfTheDay', edtMessageOfTheDay, 'Text');
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.BindGameMapList;
|
||||||
|
begin
|
||||||
|
// #ToDo1 -oMvR: 30-6-2014: load map list
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.UpdateMenu;
|
||||||
|
|
||||||
|
procedure EnablePageByInterface(APage: TTabSheet; AInterface: TGUID);
|
||||||
|
begin
|
||||||
|
PageMenuMap[APage].Enabled := Supports(ActiveGame, AInterface);
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
EnablePageByInterface(tsNetwork, IGameNetwork);
|
||||||
|
EnablePageByInterface(tsConfiguration, IGameName);
|
||||||
|
EnablePageByInterface(tsMapList, IGameMapList);
|
||||||
|
|
||||||
|
if Assigned(mbMenu.SelectedItem) and (not mbMenu.SelectedItem.Enabled) then
|
||||||
|
mbMenu.SelectFirst;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.SetActiveGame(const Value: TCustomGame);
|
||||||
|
begin
|
||||||
|
if Value <> FActiveGame then
|
||||||
|
begin
|
||||||
|
FActiveGame := Value;
|
||||||
|
ActiveGameChanged;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.mbMenuCollapsing(Sender: TObject; Group: TX2MenuBarGroup; var Allowed: Boolean);
|
||||||
|
begin
|
||||||
|
Allowed := False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.mbMenuSelectedChanged(Sender: TObject; Item: TX2CustomMenuBarItem);
|
||||||
|
begin
|
||||||
|
pcMain.ActivePageIndex := Item.Tag;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.llLinkClick(Sender: TObject; const Link: string; LinkType: TSysLinkType);
|
||||||
|
begin
|
||||||
|
ShellExecute(0, 'open', PChar(Link), nil, nil, SW_SHOWNORMAL);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.SpinEditChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
TBindings.Notify(Sender, 'Value');
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.EditChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
TBindings.Notify(Sender, 'Text');
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.actGameAddExecute(Sender: TObject);
|
||||||
|
var
|
||||||
|
game: TCustomGame;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if TGameForm.Insert(Self, game) then
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.actGameRemoveExecute(Sender: TObject);
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ TINIHintWindow }
|
||||||
|
function TINIHintWindow.CalcHintRect(MaxWidth: Integer; const AHint: string; AData: Pointer): TRect;
|
||||||
|
var
|
||||||
|
section: string;
|
||||||
|
key: string;
|
||||||
|
sectionRect: TRect;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if GetINIHint(AHint, section, key) then
|
||||||
|
begin
|
||||||
|
Canvas.Font.Style := [fsBold];
|
||||||
|
try
|
||||||
|
sectionRect := inherited CalcHintRect(MaxWidth, section, AData);
|
||||||
|
finally
|
||||||
|
Canvas.Font.Style := [];
|
||||||
|
end;
|
||||||
|
|
||||||
|
Result := inherited CalcHintRect(MaxWidth, key, AData);
|
||||||
|
|
||||||
|
Result.Right := Max(Result.Right, sectionRect.Right);
|
||||||
|
Inc(Result.Bottom, RectHeight(sectionRect));
|
||||||
|
end else
|
||||||
|
Result := inherited CalcHintRect(MaxWidth, AHint, AData);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TINIHintWindow.Paint;
|
||||||
|
var
|
||||||
|
section: string;
|
||||||
|
key: string;
|
||||||
|
textRect: TRect;
|
||||||
|
clipRect: TRect;
|
||||||
|
elementColor: TColor;
|
||||||
|
elementDetails: TThemedElementDetails;
|
||||||
|
gradientStart: TColor;
|
||||||
|
gradientEnd: TColor;
|
||||||
|
textColor: TColor;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if GetINIHint(Caption, section, key) then
|
||||||
|
begin
|
||||||
|
textRect := ClientRect;
|
||||||
|
textColor := Screen.HintFont.Color;
|
||||||
|
|
||||||
|
if StyleServices.Enabled then
|
||||||
|
begin
|
||||||
|
clipRect := textRect;
|
||||||
|
InflateRect(textRect, 4, 4);
|
||||||
|
if TOSVersion.Check(6) and StyleServices.IsSystemStyle then
|
||||||
|
begin
|
||||||
|
// Paint Windows gradient background
|
||||||
|
StyleServices.DrawElement(Canvas.Handle, StyleServices.GetElementDetails(tttStandardNormal), textRect, clipRect);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
elementDetails := StyleServices.GetElementDetails(thHintNormal);
|
||||||
|
if StyleServices.GetElementColor(elementDetails, ecGradientColor1, elementColor) and (elementColor <> clNone) then
|
||||||
|
gradientStart := elementColor
|
||||||
|
else
|
||||||
|
gradientStart := clInfoBk;
|
||||||
|
if StyleServices.GetElementColor(elementDetails, ecGradientColor2, elementColor) and (elementColor <> clNone) then
|
||||||
|
gradientEnd := elementColor
|
||||||
|
else
|
||||||
|
gradientEnd := clInfoBk;
|
||||||
|
if StyleServices.GetElementColor(elementDetails, ecTextColor, elementColor) and (elementColor <> clNone) then
|
||||||
|
textColor := elementColor
|
||||||
|
else
|
||||||
|
textColor := Screen.HintFont.Color;
|
||||||
|
GradientFillCanvas(Canvas, gradientStart, gradientEnd, textRect, gdVertical);
|
||||||
|
end;
|
||||||
|
|
||||||
|
textRect := clipRect;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Inc(textRect.Left, 2);
|
||||||
|
Inc(textRect.Top, 2);
|
||||||
|
|
||||||
|
Canvas.Font.Color := textColor;
|
||||||
|
Canvas.Font.Style := [fsBold];
|
||||||
|
try
|
||||||
|
DrawText(Canvas.Handle, section, -1, textRect, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK or DrawTextBiDiModeFlagsReadingOnly);
|
||||||
|
Inc(textRect.Top, Canvas.TextHeight(section) + 2);
|
||||||
|
finally
|
||||||
|
Canvas.Font.Style := [];
|
||||||
|
end;
|
||||||
|
|
||||||
|
DrawText(Canvas.Handle, key, -1, textRect, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK or DrawTextBiDiModeFlagsReadingOnly);
|
||||||
|
end else
|
||||||
|
inherited Paint;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TINIHintWindow.IsINIHint(const AHint: string): Boolean;
|
||||||
|
begin
|
||||||
|
Result := AnsiStartsText(INIHintPrefix, AHint);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TINIHintWindow.GetINIHint(const AHint: string; out ASection, AKey: string): Boolean;
|
||||||
|
var
|
||||||
|
hint: string;
|
||||||
|
separatorPos: Integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Result := IsINIHint(AHint);
|
||||||
|
if Result then
|
||||||
|
begin
|
||||||
|
hint := Copy(AHint, Succ(Length(INIHintPrefix)), MaxInt);
|
||||||
|
ASection := '';
|
||||||
|
AKey := hint;
|
||||||
|
|
||||||
|
separatorPos := Pos(INIHintSeparator, hint);
|
||||||
|
if separatorPos > 0 then
|
||||||
|
begin
|
||||||
|
ASection := hint;
|
||||||
|
SetLength(ASection, Pred(separatorPos));
|
||||||
|
Delete(AKey, 1, Pred(separatorPos) + Length(INIHintSeparator));
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
initialization
|
||||||
|
HintWindowClass := TINIHintWindow;
|
||||||
|
|
||||||
|
end.
|