C&C Remastered Map Editor
Initial commit of C&C Remastered Map Editor code
This commit is contained in:
parent
1f6350fe6e
commit
e37e174be1
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<section name="MobiusEditor.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
|
||||
</sectionGroup>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<section name="MobiusEditor.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
|
||||
</startup>
|
||||
<applicationSettings>
|
||||
<MobiusEditor.Properties.Settings>
|
||||
<setting name="Quality" serializeAs="String">
|
||||
<value>2</value>
|
||||
</setting>
|
||||
</MobiusEditor.Properties.Settings>
|
||||
</applicationSettings>
|
||||
<userSettings>
|
||||
<MobiusEditor.Properties.Settings>
|
||||
<setting name="ToolDialogPosition" serializeAs="String">
|
||||
<value>0, 0</value>
|
||||
</setting>
|
||||
<setting name="ShowInviteWarning" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
</MobiusEditor.Properties.Settings>
|
||||
</userSettings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<probing privatePath="bin" />
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
|
@ -0,0 +1,536 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
|
||||
<Import Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{397CEF00-8930-4EC8-B15F-F7CF7193FB22}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>MobiusEditor</RootNamespace>
|
||||
<AssemblyName Condition="'$(Configuration)'=='Debug'">CnCTDRAMapEditorD</AssemblyName>
|
||||
<AssemblyName Condition="'$(Configuration)'=='Release'">CnCTDRAMapEditor</AssemblyName>
|
||||
<AssemblyName Condition="'$(Configuration)'=='Gold'">CnCTDRAMapEditor</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;STEAMWORKS_WIN;STEAMWORKS_X64;DEVELOPER</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;STEAMWORKS_WIN;STEAMWORKS_X64;DEVELOPER</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Gold|AnyCPU'">
|
||||
<OutputPath>bin\Gold\</OutputPath>
|
||||
<DefineConstants>TRACE;STEAMWORKS_WIN;STEAMWORKS_X64</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Resources\GameIcon00.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.IO.Compression.FileSystem" />
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Controls\BasicSettings.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\BasicSettings.Designer.cs">
|
||||
<DependentUpon>BasicSettings.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\BriefingSettings.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\BriefingSettings.Designer.cs">
|
||||
<DependentUpon>BriefingSettings.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ImageTooltip.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ImageTooltip.Designer.cs">
|
||||
<DependentUpon>ImageTooltip.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\MapPanel.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\MapPanel.Designer.cs">
|
||||
<DependentUpon>MapPanel.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\MenuButton.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\MenuButton.Designer.cs">
|
||||
<DependentUpon>MenuButton.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\PropertiesComboBox.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\PropertiesComboBox.Designer.cs">
|
||||
<DependentUpon>PropertiesComboBox.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\TerrainProperties.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\TerrainProperties.Designer.cs">
|
||||
<DependentUpon>TerrainProperties.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ObjectProperties.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ObjectProperties.Designer.cs">
|
||||
<DependentUpon>ObjectProperties.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\PlayerSettings.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\PlayerSettings.Designer.cs">
|
||||
<DependentUpon>PlayerSettings.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\TypeComboBox.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\TypeComboBox.Designer.cs">
|
||||
<DependentUpon>TypeComboBox.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Dialogs\ErrorMessageBox.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Dialogs\ErrorMessageBox.Designer.cs">
|
||||
<DependentUpon>ErrorMessageBox.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Dialogs\InviteMessageBox.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Dialogs\InviteMessageBox.Designer.cs">
|
||||
<DependentUpon>InviteMessageBox.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Dialogs\MapSettingsDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Dialogs\MapSettingsDialog.Designer.cs">
|
||||
<DependentUpon>MapSettingsDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Dialogs\NewMapDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Dialogs\NewMapDialog.Designer.cs">
|
||||
<DependentUpon>NewMapDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Dialogs\SteamDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Dialogs\SteamDialog.Designer.cs">
|
||||
<DependentUpon>SteamDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Dialogs\TriggersDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Dialogs\TriggersDialog.Designer.cs">
|
||||
<DependentUpon>TriggersDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Dialogs\TeamTypesDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Dialogs\TeamTypesDialog.Designer.cs">
|
||||
<DependentUpon>TeamTypesDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Event\RenderEventArgs.cs" />
|
||||
<Compile Include="Event\UndoRedoEventArgs.cs" />
|
||||
<Compile Include="Globals.cs" />
|
||||
<Compile Include="Interface\IBrowsableType.cs" />
|
||||
<Compile Include="Interface\ICellOccupier.cs" />
|
||||
<Compile Include="Interface\ICellOverlapper.cs" />
|
||||
<Compile Include="Interface\IGamePlugin.cs" />
|
||||
<Compile Include="Interface\INamedType.cs" />
|
||||
<Compile Include="Interface\ITechnoType.cs" />
|
||||
<Compile Include="Interface\ITool.cs" />
|
||||
<Compile Include="Interface\IWidget.cs" />
|
||||
<Compile Include="MainForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainForm.Designer.cs">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Model\BasicSection.cs" />
|
||||
<Compile Include="Model\BriefingSection.cs" />
|
||||
<Compile Include="Model\Building.cs" />
|
||||
<Compile Include="Model\CellGrid.cs" />
|
||||
<Compile Include="Model\CellMetrics.cs" />
|
||||
<Compile Include="Model\CellTrigger.cs" />
|
||||
<Compile Include="Model\DirectionType.cs" />
|
||||
<Compile Include="Model\House.cs" />
|
||||
<Compile Include="Model\HouseType.cs" />
|
||||
<Compile Include="Model\BuildingType.cs" />
|
||||
<Compile Include="Model\Infantry.cs" />
|
||||
<Compile Include="Model\Map.cs" />
|
||||
<Compile Include="Model\MapSection.cs" />
|
||||
<Compile Include="Model\OccupierSet.cs" />
|
||||
<Compile Include="Model\OverlapperSet.cs" />
|
||||
<Compile Include="Model\Overlay.cs" />
|
||||
<Compile Include="Model\OverlayType.cs" />
|
||||
<Compile Include="Model\Smudge.cs" />
|
||||
<Compile Include="Model\SmudgeType.cs" />
|
||||
<Compile Include="Model\SteamSection.cs" />
|
||||
<Compile Include="Model\TeamType.cs" />
|
||||
<Compile Include="Model\Template.cs" />
|
||||
<Compile Include="Model\TemplateType.cs" />
|
||||
<Compile Include="Model\Terrain.cs" />
|
||||
<Compile Include="Model\TerrainType.cs" />
|
||||
<Compile Include="Model\TheaterType.cs" />
|
||||
<Compile Include="Model\Trigger.cs" />
|
||||
<Compile Include="Model\InfantryType.cs" />
|
||||
<Compile Include="Model\TypeItem.cs" />
|
||||
<Compile Include="Model\Unit.cs" />
|
||||
<Compile Include="Model\UnitType.cs" />
|
||||
<Compile Include="Model\Waypoint.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RedAlert\ActionDataTypes.cs" />
|
||||
<Compile Include="RedAlert\ActionTypes.cs" />
|
||||
<Compile Include="RedAlert\BasicSection.cs" />
|
||||
<Compile Include="RedAlert\BuildingTypes.cs" />
|
||||
<Compile Include="RedAlert\Constants.cs" />
|
||||
<Compile Include="RedAlert\DirectionTypes.cs" />
|
||||
<Compile Include="RedAlert\EventTypes.cs" />
|
||||
<Compile Include="RedAlert\GamePlugin.cs" />
|
||||
<Compile Include="RedAlert\House.cs" />
|
||||
<Compile Include="RedAlert\HouseTypes.cs" />
|
||||
<Compile Include="RedAlert\InfantryTypes.cs" />
|
||||
<Compile Include="RedAlert\MissionTypes.cs" />
|
||||
<Compile Include="RedAlert\OverlayTypes.cs" />
|
||||
<Compile Include="RedAlert\SmudgeTypes.cs" />
|
||||
<Compile Include="RedAlert\TeamMissionTypes.cs" />
|
||||
<Compile Include="RedAlert\TemplateTypes.cs" />
|
||||
<Compile Include="RedAlert\TerrainTypes.cs" />
|
||||
<Compile Include="RedAlert\TheaterTypes.cs" />
|
||||
<Compile Include="RedAlert\UnitTypes.cs" />
|
||||
<Compile Include="Render\MapRenderer.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamapplist.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamapps.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamclient.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamcontroller.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamfriends.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamgameserver.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamgameserverapps.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamgameserverclient.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamgameserverhttp.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamgameserverinventory.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamgameservernetworking.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamgameserverstats.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamgameserverugc.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamgameserverutils.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamhtmlsurface.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamhttp.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteaminput.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteaminventory.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteammatchmaking.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteammusic.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteammusicremote.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamnetworking.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamparentalsettings.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamremoteplay.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamremotestorage.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamscreenshots.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamugc.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamunifiedmessages.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamuser.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamuserstats.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamutils.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\isteamvideo.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\NativeMethods.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\SteamCallbacks.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\SteamConstants.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\SteamEnums.cs" />
|
||||
<Compile Include="Steamworks.NET\autogen\SteamStructs.cs" />
|
||||
<Compile Include="Steamworks.NET\CallbackDispatcher.cs" />
|
||||
<Compile Include="Steamworks.NET\CallbackIdentity.cs" />
|
||||
<Compile Include="Steamworks.NET\InteropHelp.cs" />
|
||||
<Compile Include="Steamworks.NET\ISteamMatchmakingResponses.cs" />
|
||||
<Compile Include="Steamworks.NET\Packsize.cs" />
|
||||
<Compile Include="Steamworks.NET\Steam.cs" />
|
||||
<Compile Include="Steamworks.NET\types\MatchmakingTypes\gameserveritem_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\MatchmakingTypes\servernetadr_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamClientPublic\CGameID.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamClientPublic\CSteamID.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamClientPublic\HAuthTicket.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamClient\SteamAPIWarningMessageHook_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamClient\SteamAPI_CheckCallbackRegistered_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamClient\SteamAPI_PostAPIResultInProcess_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamController\ControllerActionSetHandle_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamController\ControllerAnalogActionHandle_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamController\ControllerDigitalActionHandle_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamController\ControllerHandle_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamFriends\FriendsGroupID_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamHTMLSurface\HHTMLBrowser.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamHTTP\HTTPCookieContainerHandle.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamHTTP\HTTPRequestHandle.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamInput\InputActionSetHandle_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamInput\InputAnalogActionHandle_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamInput\InputDigitalActionHandle_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamInput\InputHandle_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamInventory\SteamInventoryResult_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamInventory\SteamInventoryUpdateHandle_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamInventory\SteamItemDef_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamInventory\SteamItemInstanceID_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamMatchmaking\HServerListRequest.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamMatchmaking\HServerQuery.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamNetworking\SNetListenSocket_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamNetworking\SNetSocket_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamRemoteStorage\PublishedFileId_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamRemoteStorage\PublishedFileUpdateHandle_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamRemoteStorage\UGCFileWriteStreamHandle_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamRemoteStorage\UGCHandle_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamScreenshots\ScreenshotHandle.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamTypes\AccountID_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamTypes\AppId_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamTypes\DepotId_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamTypes\ManifestId_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamTypes\PartyBeaconID_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamTypes\RTime32.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamTypes\SiteId_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamTypes\SteamAPICall_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamUGC\UGCQueryHandle_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamUGC\UGCUpdateHandle_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamUnifiedMessages\ClientUnifiedMessageHandle.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamUserStats\SteamLeaderboardEntries_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\SteamUserStats\SteamLeaderboard_t.cs" />
|
||||
<Compile Include="Steamworks.NET\types\Steam_api_common\HSteamPipe.cs" />
|
||||
<Compile Include="Steamworks.NET\types\Steam_api_common\HSteamUser.cs" />
|
||||
<Compile Include="TiberianDawn\ActionTypes.cs" />
|
||||
<Compile Include="TiberianDawn\BasicSection.cs" />
|
||||
<Compile Include="TiberianDawn\Constants.cs" />
|
||||
<Compile Include="TiberianDawn\DirectionTypes.cs" />
|
||||
<Compile Include="TiberianDawn\EventTypes.cs" />
|
||||
<Compile Include="TiberianDawn\GamePlugin.cs" />
|
||||
<Compile Include="TiberianDawn\House.cs" />
|
||||
<Compile Include="TiberianDawn\HouseTypes.cs" />
|
||||
<Compile Include="TiberianDawn\BuildingTypes.cs" />
|
||||
<Compile Include="TiberianDawn\MissionTypes.cs" />
|
||||
<Compile Include="TiberianDawn\OverlayTypes.cs" />
|
||||
<Compile Include="TiberianDawn\SmudgeTypes.cs" />
|
||||
<Compile Include="TiberianDawn\TeamMissionTypes.cs" />
|
||||
<Compile Include="TiberianDawn\TemplateTypes.cs" />
|
||||
<Compile Include="TiberianDawn\TerrainTypes.cs" />
|
||||
<Compile Include="TiberianDawn\TheaterTypes.cs" />
|
||||
<Compile Include="TiberianDawn\InfantryTypes.cs" />
|
||||
<Compile Include="TiberianDawn\UnitTypes.cs" />
|
||||
<Compile Include="Tools\BuildingTool.cs" />
|
||||
<Compile Include="Tools\Dialogs\ResourcesToolDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tools\Dialogs\ResourcesToolDialog.Designer.cs">
|
||||
<DependentUpon>ResourcesToolDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Tools\Dialogs\ObjectToolDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tools\Dialogs\ObjectToolDialog.Designer.cs">
|
||||
<DependentUpon>ObjectToolDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Tools\Dialogs\GenericToolDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tools\Dialogs\GenericToolDialog.Designer.cs">
|
||||
<DependentUpon>GenericToolDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Tools\Dialogs\TerrainToolDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tools\Dialogs\TerrainToolDialog.Designer.cs">
|
||||
<DependentUpon>TerrainToolDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Tools\Dialogs\TemplateToolDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tools\Dialogs\TemplateToolDialog.Designer.cs">
|
||||
<DependentUpon>TemplateToolDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Tools\Dialogs\CellTriggersToolDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tools\Dialogs\CellTriggersToolDialog.Designer.cs">
|
||||
<DependentUpon>CellTriggersToolDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Tools\Dialogs\WaypointsToolDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tools\Dialogs\WaypointsToolDialog.Designer.cs">
|
||||
<DependentUpon>WaypointsToolDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Tools\InfantryTool.cs" />
|
||||
<Compile Include="Tools\OverlaysTool.cs" />
|
||||
<Compile Include="Tools\ResourcesTool.cs" />
|
||||
<Compile Include="Tools\SmudgeTool.cs" />
|
||||
<Compile Include="Tools\TemplateTool.cs" />
|
||||
<Compile Include="Tools\TerrainTool.cs" />
|
||||
<Compile Include="Tools\UnitTool.cs" />
|
||||
<Compile Include="Tools\ViewTool.cs" />
|
||||
<Compile Include="Tools\WallsTool.cs" />
|
||||
<Compile Include="Tools\CellTriggersTool.cs" />
|
||||
<Compile Include="Tools\WaypointsTool.cs" />
|
||||
<Compile Include="Utility\CRC.cs" />
|
||||
<Compile Include="Utility\ExtensionMethods.cs" />
|
||||
<Compile Include="Utility\GameTextManager.cs" />
|
||||
<Compile Include="Utility\INI.cs" />
|
||||
<Compile Include="Utility\Megafile.cs" />
|
||||
<Compile Include="Utility\MegafileBuilder.cs" />
|
||||
<Compile Include="Utility\MegafileManager.cs" />
|
||||
<Compile Include="Utility\MRU.cs" />
|
||||
<Compile Include="Utility\PropertyTracker.cs" />
|
||||
<Compile Include="Utility\SteamworksUGC.cs" />
|
||||
<Compile Include="Utility\TeamColor.cs" />
|
||||
<Compile Include="Utility\TeamColorManager.cs" />
|
||||
<Compile Include="Utility\TextureManager.cs" />
|
||||
<Compile Include="Utility\TGASharpLib.cs" />
|
||||
<Compile Include="Utility\Tileset.cs" />
|
||||
<Compile Include="Utility\TilesetManager.cs" />
|
||||
<Compile Include="Utility\UndoRedoList.cs" />
|
||||
<Compile Include="Utility\WWCompression.cs" />
|
||||
<Compile Include="Widgets\NavigationWidget.cs" />
|
||||
<EmbeddedResource Include="Controls\BasicSettings.resx">
|
||||
<DependentUpon>BasicSettings.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Controls\BriefingSettings.resx">
|
||||
<DependentUpon>BriefingSettings.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Controls\MapPanel.resx">
|
||||
<DependentUpon>MapPanel.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Controls\TerrainProperties.resx">
|
||||
<DependentUpon>TerrainProperties.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Controls\ObjectProperties.resx">
|
||||
<DependentUpon>ObjectProperties.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Controls\PlayerSettings.resx">
|
||||
<DependentUpon>PlayerSettings.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Dialogs\ErrorMessageBox.resx">
|
||||
<DependentUpon>ErrorMessageBox.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Dialogs\InviteMessageBox.resx">
|
||||
<DependentUpon>InviteMessageBox.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Dialogs\MapSettingsDialog.resx">
|
||||
<DependentUpon>MapSettingsDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Dialogs\NewMapDialog.resx">
|
||||
<DependentUpon>NewMapDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Dialogs\SteamDialog.resx">
|
||||
<DependentUpon>SteamDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Dialogs\TriggersDialog.resx">
|
||||
<DependentUpon>TriggersDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Dialogs\TeamTypesDialog.resx">
|
||||
<DependentUpon>TeamTypesDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainForm.resx">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Tools\Dialogs\ResourcesToolDialog.resx">
|
||||
<DependentUpon>ResourcesToolDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Tools\Dialogs\ObjectToolDialog.resx">
|
||||
<DependentUpon>ObjectToolDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Tools\Dialogs\GenericToolDialog.resx">
|
||||
<DependentUpon>GenericToolDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Tools\Dialogs\TerrainToolDialog.resx">
|
||||
<DependentUpon>TerrainToolDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Tools\Dialogs\TemplateToolDialog.resx">
|
||||
<DependentUpon>TemplateToolDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Tools\Dialogs\CellTriggersToolDialog.resx">
|
||||
<DependentUpon>CellTriggersToolDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Tools\Dialogs\WaypointsToolDialog.resx">
|
||||
<DependentUpon>WaypointsToolDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\GameIcon00.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\UI_CustomMissionPreviewDefault.png" />
|
||||
<Content Include="Steamworks.NET\redist\steam_api.dll" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json">
|
||||
<Version>12.0.3</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Pfim">
|
||||
<Version>0.9.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.ValueTuple">
|
||||
<Version>4.5.0</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,518 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
partial class BasicSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.loseComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.isSinglePlayerCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.win4ComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.win3ComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.win2ComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.winComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.actionComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.briefComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.introComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.win4Label = new System.Windows.Forms.Label();
|
||||
this.win3Label = new System.Windows.Forms.Label();
|
||||
this.win2Label = new System.Windows.Forms.Label();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.buildLevelLabel = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.nameTxt = new System.Windows.Forms.TextBox();
|
||||
this.playerComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.buidLevelNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.percentNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.carryOverMoneyNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.authorTxt = new System.Windows.Forms.TextBox();
|
||||
this.baseLabel = new System.Windows.Forms.Label();
|
||||
this.baseComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.buidLevelNud)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.percentNud)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.carryOverMoneyNud)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.AutoSize = true;
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.label10, 0, 15);
|
||||
this.tableLayoutPanel1.Controls.Add(this.loseComboBox, 1, 15);
|
||||
this.tableLayoutPanel1.Controls.Add(this.isSinglePlayerCheckBox, 1, 16);
|
||||
this.tableLayoutPanel1.Controls.Add(this.win4ComboBox, 1, 14);
|
||||
this.tableLayoutPanel1.Controls.Add(this.win3ComboBox, 1, 13);
|
||||
this.tableLayoutPanel1.Controls.Add(this.win2ComboBox, 1, 12);
|
||||
this.tableLayoutPanel1.Controls.Add(this.winComboBox, 1, 11);
|
||||
this.tableLayoutPanel1.Controls.Add(this.actionComboBox, 1, 10);
|
||||
this.tableLayoutPanel1.Controls.Add(this.briefComboBox, 1, 9);
|
||||
this.tableLayoutPanel1.Controls.Add(this.introComboBox, 1, 8);
|
||||
this.tableLayoutPanel1.Controls.Add(this.win4Label, 0, 14);
|
||||
this.tableLayoutPanel1.Controls.Add(this.win3Label, 0, 13);
|
||||
this.tableLayoutPanel1.Controls.Add(this.win2Label, 0, 12);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label9, 0, 11);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label8, 0, 10);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label7, 0, 9);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 8);
|
||||
this.tableLayoutPanel1.Controls.Add(this.buildLevelLabel, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label3, 0, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label4, 0, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label5, 0, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.nameTxt, 1, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.playerComboBox, 1, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.buidLevelNud, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.percentNud, 1, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.carryOverMoneyNud, 1, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label6, 0, 5);
|
||||
this.tableLayoutPanel1.Controls.Add(this.authorTxt, 1, 5);
|
||||
this.tableLayoutPanel1.Controls.Add(this.baseLabel, 0, 6);
|
||||
this.tableLayoutPanel1.Controls.Add(this.baseComboBox, 1, 6);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 17;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(300, 403);
|
||||
this.tableLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// label10
|
||||
//
|
||||
this.label10.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label10.Location = new System.Drawing.Point(2, 355);
|
||||
this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(87, 25);
|
||||
this.label10.TabIndex = 35;
|
||||
this.label10.Text = "Lose";
|
||||
this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// loseComboBox
|
||||
//
|
||||
this.loseComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.loseComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.loseComboBox.FormattingEnabled = true;
|
||||
this.loseComboBox.Location = new System.Drawing.Point(93, 357);
|
||||
this.loseComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.loseComboBox.Name = "loseComboBox";
|
||||
this.loseComboBox.Size = new System.Drawing.Size(205, 21);
|
||||
this.loseComboBox.TabIndex = 34;
|
||||
//
|
||||
// isSinglePlayerCheckBox
|
||||
//
|
||||
this.isSinglePlayerCheckBox.AutoSize = true;
|
||||
this.isSinglePlayerCheckBox.Location = new System.Drawing.Point(93, 382);
|
||||
this.isSinglePlayerCheckBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.isSinglePlayerCheckBox.Name = "isSinglePlayerCheckBox";
|
||||
this.isSinglePlayerCheckBox.Size = new System.Drawing.Size(87, 17);
|
||||
this.isSinglePlayerCheckBox.TabIndex = 32;
|
||||
this.isSinglePlayerCheckBox.Text = "Single-Player";
|
||||
this.isSinglePlayerCheckBox.UseVisualStyleBackColor = true;
|
||||
this.isSinglePlayerCheckBox.CheckedChanged += new System.EventHandler(this.isSinglePlayerCheckBox_CheckedChanged);
|
||||
//
|
||||
// win4ComboBox
|
||||
//
|
||||
this.win4ComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.win4ComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.win4ComboBox.FormattingEnabled = true;
|
||||
this.win4ComboBox.Location = new System.Drawing.Point(93, 332);
|
||||
this.win4ComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.win4ComboBox.Name = "win4ComboBox";
|
||||
this.win4ComboBox.Size = new System.Drawing.Size(205, 21);
|
||||
this.win4ComboBox.TabIndex = 31;
|
||||
//
|
||||
// win3ComboBox
|
||||
//
|
||||
this.win3ComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.win3ComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.win3ComboBox.FormattingEnabled = true;
|
||||
this.win3ComboBox.Location = new System.Drawing.Point(93, 307);
|
||||
this.win3ComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.win3ComboBox.Name = "win3ComboBox";
|
||||
this.win3ComboBox.Size = new System.Drawing.Size(205, 21);
|
||||
this.win3ComboBox.TabIndex = 30;
|
||||
//
|
||||
// win2ComboBox
|
||||
//
|
||||
this.win2ComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.win2ComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.win2ComboBox.FormattingEnabled = true;
|
||||
this.win2ComboBox.Location = new System.Drawing.Point(93, 282);
|
||||
this.win2ComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.win2ComboBox.Name = "win2ComboBox";
|
||||
this.win2ComboBox.Size = new System.Drawing.Size(205, 21);
|
||||
this.win2ComboBox.TabIndex = 29;
|
||||
//
|
||||
// winComboBox
|
||||
//
|
||||
this.winComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.winComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.winComboBox.FormattingEnabled = true;
|
||||
this.winComboBox.Location = new System.Drawing.Point(93, 257);
|
||||
this.winComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.winComboBox.Name = "winComboBox";
|
||||
this.winComboBox.Size = new System.Drawing.Size(205, 21);
|
||||
this.winComboBox.TabIndex = 28;
|
||||
//
|
||||
// actionComboBox
|
||||
//
|
||||
this.actionComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.actionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.actionComboBox.FormattingEnabled = true;
|
||||
this.actionComboBox.Location = new System.Drawing.Point(93, 232);
|
||||
this.actionComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.actionComboBox.Name = "actionComboBox";
|
||||
this.actionComboBox.Size = new System.Drawing.Size(205, 21);
|
||||
this.actionComboBox.TabIndex = 27;
|
||||
//
|
||||
// briefComboBox
|
||||
//
|
||||
this.briefComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.briefComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.briefComboBox.FormattingEnabled = true;
|
||||
this.briefComboBox.Location = new System.Drawing.Point(93, 207);
|
||||
this.briefComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.briefComboBox.Name = "briefComboBox";
|
||||
this.briefComboBox.Size = new System.Drawing.Size(205, 21);
|
||||
this.briefComboBox.TabIndex = 26;
|
||||
//
|
||||
// introComboBox
|
||||
//
|
||||
this.introComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.introComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.introComboBox.FormattingEnabled = true;
|
||||
this.introComboBox.Location = new System.Drawing.Point(93, 182);
|
||||
this.introComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.introComboBox.Name = "introComboBox";
|
||||
this.introComboBox.Size = new System.Drawing.Size(205, 21);
|
||||
this.introComboBox.TabIndex = 25;
|
||||
//
|
||||
// win4Label
|
||||
//
|
||||
this.win4Label.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.win4Label.Location = new System.Drawing.Point(2, 330);
|
||||
this.win4Label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.win4Label.Name = "win4Label";
|
||||
this.win4Label.Size = new System.Drawing.Size(87, 25);
|
||||
this.win4Label.TabIndex = 24;
|
||||
this.win4Label.Text = "Win4";
|
||||
this.win4Label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// win3Label
|
||||
//
|
||||
this.win3Label.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.win3Label.Location = new System.Drawing.Point(2, 305);
|
||||
this.win3Label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.win3Label.Name = "win3Label";
|
||||
this.win3Label.Size = new System.Drawing.Size(87, 25);
|
||||
this.win3Label.TabIndex = 23;
|
||||
this.win3Label.Text = "Win3";
|
||||
this.win3Label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// win2Label
|
||||
//
|
||||
this.win2Label.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.win2Label.Location = new System.Drawing.Point(2, 280);
|
||||
this.win2Label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.win2Label.Name = "win2Label";
|
||||
this.win2Label.Size = new System.Drawing.Size(87, 25);
|
||||
this.win2Label.TabIndex = 22;
|
||||
this.win2Label.Text = "Win2";
|
||||
this.win2Label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label9.Location = new System.Drawing.Point(2, 255);
|
||||
this.label9.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(87, 25);
|
||||
this.label9.TabIndex = 21;
|
||||
this.label9.Text = "Win";
|
||||
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label8.Location = new System.Drawing.Point(2, 230);
|
||||
this.label8.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(87, 25);
|
||||
this.label8.TabIndex = 20;
|
||||
this.label8.Text = "Action";
|
||||
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label7.Location = new System.Drawing.Point(2, 205);
|
||||
this.label7.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(87, 25);
|
||||
this.label7.TabIndex = 19;
|
||||
this.label7.Text = "Brief";
|
||||
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label1.Location = new System.Drawing.Point(2, 180);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(87, 25);
|
||||
this.label1.TabIndex = 18;
|
||||
this.label1.Text = "Intro";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// buildLevelLabel
|
||||
//
|
||||
this.buildLevelLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.buildLevelLabel.Location = new System.Drawing.Point(3, 0);
|
||||
this.buildLevelLabel.Name = "buildLevelLabel";
|
||||
this.buildLevelLabel.Size = new System.Drawing.Size(85, 26);
|
||||
this.buildLevelLabel.TabIndex = 0;
|
||||
this.buildLevelLabel.Text = "Build Level";
|
||||
this.buildLevelLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label2.Location = new System.Drawing.Point(3, 26);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(85, 26);
|
||||
this.label2.TabIndex = 2;
|
||||
this.label2.Text = "Carryover Money";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label3.Location = new System.Drawing.Point(3, 52);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(85, 26);
|
||||
this.label3.TabIndex = 3;
|
||||
this.label3.Text = "Name";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label4.Location = new System.Drawing.Point(3, 78);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(85, 26);
|
||||
this.label4.TabIndex = 4;
|
||||
this.label4.Text = "Percent";
|
||||
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label5.Location = new System.Drawing.Point(3, 104);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(85, 27);
|
||||
this.label5.TabIndex = 5;
|
||||
this.label5.Text = "Player";
|
||||
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// nameTxt
|
||||
//
|
||||
this.nameTxt.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.nameTxt.Location = new System.Drawing.Point(94, 55);
|
||||
this.nameTxt.Name = "nameTxt";
|
||||
this.nameTxt.Size = new System.Drawing.Size(203, 20);
|
||||
this.nameTxt.TabIndex = 7;
|
||||
//
|
||||
// playerComboBox
|
||||
//
|
||||
this.playerComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.playerComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.playerComboBox.FormattingEnabled = true;
|
||||
this.playerComboBox.Location = new System.Drawing.Point(94, 107);
|
||||
this.playerComboBox.Name = "playerComboBox";
|
||||
this.playerComboBox.Size = new System.Drawing.Size(203, 21);
|
||||
this.playerComboBox.TabIndex = 9;
|
||||
//
|
||||
// buidLevelNud
|
||||
//
|
||||
this.buidLevelNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.buidLevelNud.Location = new System.Drawing.Point(94, 3);
|
||||
this.buidLevelNud.Name = "buidLevelNud";
|
||||
this.buidLevelNud.Size = new System.Drawing.Size(203, 20);
|
||||
this.buidLevelNud.TabIndex = 10;
|
||||
//
|
||||
// percentNud
|
||||
//
|
||||
this.percentNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.percentNud.Location = new System.Drawing.Point(94, 81);
|
||||
this.percentNud.Name = "percentNud";
|
||||
this.percentNud.Size = new System.Drawing.Size(203, 20);
|
||||
this.percentNud.TabIndex = 11;
|
||||
//
|
||||
// carryOverMoneyNud
|
||||
//
|
||||
this.carryOverMoneyNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.carryOverMoneyNud.Location = new System.Drawing.Point(94, 29);
|
||||
this.carryOverMoneyNud.Name = "carryOverMoneyNud";
|
||||
this.carryOverMoneyNud.Size = new System.Drawing.Size(203, 20);
|
||||
this.carryOverMoneyNud.TabIndex = 12;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label6.Location = new System.Drawing.Point(2, 131);
|
||||
this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(87, 24);
|
||||
this.label6.TabIndex = 13;
|
||||
this.label6.Text = "Author";
|
||||
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// authorTxt
|
||||
//
|
||||
this.authorTxt.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.authorTxt.Location = new System.Drawing.Point(93, 133);
|
||||
this.authorTxt.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.authorTxt.Name = "authorTxt";
|
||||
this.authorTxt.Size = new System.Drawing.Size(205, 20);
|
||||
this.authorTxt.TabIndex = 14;
|
||||
//
|
||||
// baseLabel
|
||||
//
|
||||
this.baseLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.baseLabel.Location = new System.Drawing.Point(2, 155);
|
||||
this.baseLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.baseLabel.Name = "baseLabel";
|
||||
this.baseLabel.Size = new System.Drawing.Size(87, 25);
|
||||
this.baseLabel.TabIndex = 15;
|
||||
this.baseLabel.Text = "Base";
|
||||
this.baseLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// baseComboBox
|
||||
//
|
||||
this.baseComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.baseComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.baseComboBox.FormattingEnabled = true;
|
||||
this.baseComboBox.Location = new System.Drawing.Point(93, 157);
|
||||
this.baseComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.baseComboBox.Name = "baseComboBox";
|
||||
this.baseComboBox.Size = new System.Drawing.Size(205, 21);
|
||||
this.baseComboBox.TabIndex = 16;
|
||||
//
|
||||
// BasicSettings
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Name = "BasicSettings";
|
||||
this.Size = new System.Drawing.Size(300, 403);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.buidLevelNud)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.percentNud)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.carryOverMoneyNud)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Label buildLevelLabel;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.TextBox nameTxt;
|
||||
private System.Windows.Forms.ComboBox playerComboBox;
|
||||
private System.Windows.Forms.NumericUpDown buidLevelNud;
|
||||
private System.Windows.Forms.NumericUpDown percentNud;
|
||||
private System.Windows.Forms.NumericUpDown carryOverMoneyNud;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.TextBox authorTxt;
|
||||
private System.Windows.Forms.Label baseLabel;
|
||||
private System.Windows.Forms.ComboBox baseComboBox;
|
||||
private System.Windows.Forms.Label win4Label;
|
||||
private System.Windows.Forms.Label win3Label;
|
||||
private System.Windows.Forms.Label win2Label;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.CheckBox isSinglePlayerCheckBox;
|
||||
private System.Windows.Forms.ComboBox win4ComboBox;
|
||||
private System.Windows.Forms.ComboBox win3ComboBox;
|
||||
private System.Windows.Forms.ComboBox win2ComboBox;
|
||||
private System.Windows.Forms.ComboBox winComboBox;
|
||||
private System.Windows.Forms.ComboBox actionComboBox;
|
||||
private System.Windows.Forms.ComboBox briefComboBox;
|
||||
private System.Windows.Forms.ComboBox introComboBox;
|
||||
private System.Windows.Forms.ComboBox loseComboBox;
|
||||
private System.Windows.Forms.Label label10;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
public partial class BasicSettings : UserControl
|
||||
{
|
||||
public BasicSettings(IGamePlugin plugin, dynamic basicSection)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
playerComboBox.DataSource = plugin.Map.Houses.Select(h => h.Type.Name).ToArray();
|
||||
baseComboBox.DataSource = plugin.Map.Houses.Select(h => h.Type.Name).ToArray();
|
||||
introComboBox.DataSource = plugin.Map.MovieTypes.ToArray();
|
||||
briefComboBox.DataSource = plugin.Map.MovieTypes.ToArray();
|
||||
actionComboBox.DataSource = plugin.Map.MovieTypes.ToArray();
|
||||
winComboBox.DataSource = plugin.Map.MovieTypes.ToArray();
|
||||
win2ComboBox.DataSource = plugin.Map.MovieTypes.ToArray();
|
||||
win3ComboBox.DataSource = plugin.Map.MovieTypes.ToArray();
|
||||
win4ComboBox.DataSource = plugin.Map.MovieTypes.ToArray();
|
||||
loseComboBox.DataSource = plugin.Map.MovieTypes.ToArray();
|
||||
|
||||
carryOverMoneyNud.DataBindings.Add("Value", basicSection, "CarryOverMoney");
|
||||
nameTxt.DataBindings.Add("Text", basicSection, "Name");
|
||||
percentNud.DataBindings.Add("Value", basicSection, "Percent");
|
||||
playerComboBox.DataBindings.Add("SelectedItem", basicSection, "Player");
|
||||
authorTxt.DataBindings.Add("Text", basicSection, "Author");
|
||||
isSinglePlayerCheckBox.DataBindings.Add("Checked", basicSection, "SoloMission");
|
||||
introComboBox.DataBindings.Add("SelectedItem", basicSection, "Intro");
|
||||
briefComboBox.DataBindings.Add("SelectedItem", basicSection, "Brief");
|
||||
actionComboBox.DataBindings.Add("SelectedItem", basicSection, "Action");
|
||||
winComboBox.DataBindings.Add("SelectedItem", basicSection, "Win");
|
||||
loseComboBox.DataBindings.Add("SelectedItem", basicSection, "Lose");
|
||||
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
buidLevelNud.DataBindings.Add("Value", basicSection, "BuildLevel");
|
||||
baseLabel.Visible = baseComboBox.Visible = false;
|
||||
win2Label.Visible = win2ComboBox.Visible = false;
|
||||
win3Label.Visible = win3ComboBox.Visible = false;
|
||||
win4Label.Visible = win4ComboBox.Visible = false;
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
buidLevelNud.Visible = buildLevelLabel.Visible = false;
|
||||
baseComboBox.DataBindings.Add("SelectedItem", basicSection, "BasePlayer");
|
||||
win2ComboBox.DataBindings.Add("SelectedItem", basicSection, "Win2");
|
||||
win3ComboBox.DataBindings.Add("SelectedItem", basicSection, "Win3");
|
||||
win4ComboBox.DataBindings.Add("SelectedItem", basicSection, "Win4");
|
||||
break;
|
||||
}
|
||||
|
||||
introComboBox.Enabled = briefComboBox.Enabled = actionComboBox.Enabled = loseComboBox.Enabled = isSinglePlayerCheckBox.Checked;
|
||||
winComboBox.Enabled = win2ComboBox.Enabled = win3ComboBox.Enabled = win4ComboBox.Enabled = isSinglePlayerCheckBox.Checked;
|
||||
}
|
||||
|
||||
private void isSinglePlayerCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
introComboBox.Enabled = briefComboBox.Enabled = actionComboBox.Enabled = loseComboBox.Enabled = isSinglePlayerCheckBox.Checked;
|
||||
winComboBox.Enabled = win2ComboBox.Enabled = win3ComboBox.Enabled = win4ComboBox.Enabled = isSinglePlayerCheckBox.Checked;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -0,0 +1,75 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
partial class BriefingSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.briefingTxt = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// briefingTxt
|
||||
//
|
||||
this.briefingTxt.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.briefingTxt.Location = new System.Drawing.Point(0, 0);
|
||||
this.briefingTxt.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.briefingTxt.Multiline = true;
|
||||
this.briefingTxt.Name = "briefingTxt";
|
||||
this.briefingTxt.Size = new System.Drawing.Size(600, 400);
|
||||
this.briefingTxt.TabIndex = 0;
|
||||
//
|
||||
// BriefingSettings
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.briefingTxt);
|
||||
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.Name = "BriefingSettings";
|
||||
this.Size = new System.Drawing.Size(600, 400);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox briefingTxt;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
public partial class BriefingSettings : UserControl
|
||||
{
|
||||
public BriefingSettings(IGamePlugin plugin, dynamic briefingSection)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
briefingTxt.DataBindings.Add("Text", briefingSection, "Briefing");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -0,0 +1,50 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
partial class ImageTooltip
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
public partial class ImageTooltip : ToolTip
|
||||
{
|
||||
public Size MaxSize { get; set; } = Size.Empty;
|
||||
|
||||
public ImageTooltip()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
OwnerDraw = true;
|
||||
Popup += ImageTooltip_Popup;
|
||||
Draw += ImageTooltip_Draw;
|
||||
}
|
||||
|
||||
private void ImageTooltip_Popup(object sender, PopupEventArgs e)
|
||||
{
|
||||
if (e.AssociatedControl.Tag is Image image)
|
||||
{
|
||||
var size = image.Size;
|
||||
if (MaxSize.Width > 0)
|
||||
{
|
||||
size.Width = Math.Min(MaxSize.Width, size.Width);
|
||||
}
|
||||
if (MaxSize.Height > 0)
|
||||
{
|
||||
size.Height = Math.Min(MaxSize.Height, size.Height);
|
||||
}
|
||||
|
||||
e.ToolTipSize = size;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void ImageTooltip_Draw(object sender, DrawToolTipEventArgs e)
|
||||
{
|
||||
if (e.AssociatedControl.Tag is Image image)
|
||||
{
|
||||
e.Graphics.DrawImage(image, e.Bounds);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
partial class MapPanel
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.SuspendLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,535 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Event;
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Model;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
public partial class MapPanel : Panel
|
||||
{
|
||||
private bool updatingCamera;
|
||||
private Rectangle cameraBounds;
|
||||
private Point lastScrollPosition;
|
||||
|
||||
private (Point map, SizeF client)? referencePositions;
|
||||
|
||||
private Matrix mapToViewTransform = new Matrix();
|
||||
private Matrix viewToPageTransform = new Matrix();
|
||||
|
||||
private Matrix compositeTransform = new Matrix();
|
||||
private Matrix invCompositeTransform = new Matrix();
|
||||
|
||||
private readonly HashSet<Point> invalidateCells = new HashSet<Point>();
|
||||
private bool fullInvalidation;
|
||||
|
||||
private Image mapImage;
|
||||
public Image MapImage
|
||||
{
|
||||
get => mapImage;
|
||||
set
|
||||
{
|
||||
if (mapImage != value)
|
||||
{
|
||||
mapImage = value;
|
||||
UpdateCamera();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int minZoom = 1;
|
||||
public int MinZoom
|
||||
{
|
||||
get => minZoom;
|
||||
set
|
||||
{
|
||||
if (minZoom != value)
|
||||
{
|
||||
minZoom = value;
|
||||
Zoom = zoom;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int maxZoom = 8;
|
||||
public int MaxZoom
|
||||
{
|
||||
get => maxZoom;
|
||||
set
|
||||
{
|
||||
if (maxZoom != value)
|
||||
{
|
||||
maxZoom = value;
|
||||
Zoom = zoom;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int zoomStep = 1;
|
||||
public int ZoomStep
|
||||
{
|
||||
get => zoomStep;
|
||||
set
|
||||
{
|
||||
if (zoomStep != value)
|
||||
{
|
||||
zoomStep = value;
|
||||
Zoom = (Zoom / zoomStep) * zoomStep;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int zoom = 1;
|
||||
public int Zoom
|
||||
{
|
||||
get => zoom;
|
||||
set
|
||||
{
|
||||
var newZoom = Math.Max(MinZoom, Math.Min(MaxZoom, value));
|
||||
if (zoom != newZoom)
|
||||
{
|
||||
zoom = newZoom;
|
||||
|
||||
var clientPosition = PointToClient(MousePosition);
|
||||
referencePositions = (ClientToMap(clientPosition), new SizeF(clientPosition.X / (float)ClientSize.Width, clientPosition.Y / (float)ClientSize.Height));
|
||||
|
||||
UpdateCamera();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int quality = Properties.Settings.Default.Quality;
|
||||
public int Quality
|
||||
{
|
||||
get => quality;
|
||||
set
|
||||
{
|
||||
if (quality != value)
|
||||
{
|
||||
quality = value;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Behavior")]
|
||||
[DefaultValue(false)]
|
||||
public bool FocusOnMouseEnter { get; set; }
|
||||
|
||||
public event EventHandler<RenderEventArgs> PreRender;
|
||||
public event EventHandler<RenderEventArgs> PostRender;
|
||||
|
||||
public MapPanel()
|
||||
{
|
||||
InitializeComponent();
|
||||
DoubleBuffered = true;
|
||||
}
|
||||
|
||||
public Point MapToClient(Point point)
|
||||
{
|
||||
var points = new Point[] { point };
|
||||
compositeTransform.TransformPoints(points);
|
||||
return points[0];
|
||||
}
|
||||
|
||||
public Size MapToClient(Size size)
|
||||
{
|
||||
var points = new Point[] { (Point)size };
|
||||
compositeTransform.VectorTransformPoints(points);
|
||||
return (Size)points[0];
|
||||
}
|
||||
|
||||
public Rectangle MapToClient(Rectangle rectangle)
|
||||
{
|
||||
var points = new Point[] { rectangle.Location, new Point(rectangle.Right, rectangle.Bottom) };
|
||||
compositeTransform.TransformPoints(points);
|
||||
return new Rectangle(points[0], new Size(points[1].X - points[0].X, points[1].Y - points[0].Y));
|
||||
}
|
||||
|
||||
public Point ClientToMap(Point point)
|
||||
{
|
||||
var points = new Point[] { point };
|
||||
invCompositeTransform.TransformPoints(points);
|
||||
return points[0];
|
||||
}
|
||||
|
||||
public Size ClientToMap(Size size)
|
||||
{
|
||||
var points = new Point[] { (Point)size };
|
||||
invCompositeTransform.VectorTransformPoints(points);
|
||||
return (Size)points[0];
|
||||
}
|
||||
|
||||
public Rectangle ClientToMap(Rectangle rectangle)
|
||||
{
|
||||
var points = new Point[] { rectangle.Location, new Point(rectangle.Right, rectangle.Bottom) };
|
||||
invCompositeTransform.TransformPoints(points);
|
||||
return new Rectangle(points[0], new Size(points[1].X - points[0].X, points[1].Y - points[0].Y));
|
||||
}
|
||||
|
||||
public void Invalidate(Map invalidateMap)
|
||||
{
|
||||
if (!fullInvalidation)
|
||||
{
|
||||
invalidateCells.Clear();
|
||||
fullInvalidation = true;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
public void Invalidate(Map invalidateMap, Rectangle cellBounds)
|
||||
{
|
||||
if (fullInvalidation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var count = invalidateCells.Count;
|
||||
invalidateCells.UnionWith(cellBounds.Points());
|
||||
if (invalidateCells.Count > count)
|
||||
{
|
||||
var overlapCells = invalidateMap.Overlappers.Overlaps(invalidateCells).ToHashSet();
|
||||
invalidateCells.UnionWith(overlapCells);
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
public void Invalidate(Map invalidateMap, IEnumerable<Rectangle> cellBounds)
|
||||
{
|
||||
if (fullInvalidation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var count = invalidateCells.Count;
|
||||
invalidateCells.UnionWith(cellBounds.SelectMany(c => c.Points()));
|
||||
if (invalidateCells.Count > count)
|
||||
{
|
||||
var overlapCells = invalidateMap.Overlappers.Overlaps(invalidateCells).ToHashSet();
|
||||
invalidateCells.UnionWith(overlapCells);
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
public void Invalidate(Map invalidateMap, Point location)
|
||||
{
|
||||
if (fullInvalidation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Invalidate(invalidateMap, new Rectangle(location, new Size(1, 1)));
|
||||
}
|
||||
|
||||
public void Invalidate(Map invalidateMap, IEnumerable<Point> locations)
|
||||
{
|
||||
if (fullInvalidation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Invalidate(invalidateMap, locations.Select(l => new Rectangle(l, new Size(1, 1))));
|
||||
}
|
||||
|
||||
public void Invalidate(Map invalidateMap, int cell)
|
||||
{
|
||||
if (fullInvalidation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (invalidateMap.Metrics.GetLocation(cell, out Point location))
|
||||
{
|
||||
Invalidate(invalidateMap, location);
|
||||
}
|
||||
}
|
||||
|
||||
public void Invalidate(Map invalidateMap, IEnumerable<int> cells)
|
||||
{
|
||||
if (fullInvalidation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Invalidate(invalidateMap, cells
|
||||
.Where(c => invalidateMap.Metrics.GetLocation(c, out Point location))
|
||||
.Select(c =>
|
||||
{
|
||||
invalidateMap.Metrics.GetLocation(c, out Point location);
|
||||
return location;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
public void Invalidate(Map invalidateMap, ICellOverlapper overlapper)
|
||||
{
|
||||
if (fullInvalidation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var rectangle = invalidateMap.Overlappers[overlapper];
|
||||
if (rectangle.HasValue)
|
||||
{
|
||||
Invalidate(invalidateMap, rectangle.Value);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMouseEnter(EventArgs e)
|
||||
{
|
||||
base.OnMouseEnter(e);
|
||||
|
||||
if (FocusOnMouseEnter)
|
||||
{
|
||||
Focus();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMouseWheel(MouseEventArgs e)
|
||||
{
|
||||
Zoom += ZoomStep * Math.Sign(e.Delta);
|
||||
}
|
||||
|
||||
protected override void OnClientSizeChanged(EventArgs e)
|
||||
{
|
||||
base.OnClientSizeChanged(e);
|
||||
|
||||
UpdateCamera();
|
||||
}
|
||||
|
||||
protected override void OnScroll(ScrollEventArgs se)
|
||||
{
|
||||
base.OnScroll(se);
|
||||
|
||||
InvalidateScroll();
|
||||
}
|
||||
|
||||
protected override void OnPaintBackground(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaintBackground(e);
|
||||
|
||||
e.Graphics.Clear(BackColor);
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs pe)
|
||||
{
|
||||
base.OnPaint(pe);
|
||||
|
||||
InvalidateScroll();
|
||||
|
||||
PreRender?.Invoke(this, new RenderEventArgs(pe.Graphics, fullInvalidation ? null : invalidateCells));
|
||||
|
||||
if (mapImage != null)
|
||||
{
|
||||
pe.Graphics.Transform = compositeTransform;
|
||||
|
||||
var oldCompositingMode = pe.Graphics.CompositingMode;
|
||||
var oldCompositingQuality = pe.Graphics.CompositingQuality;
|
||||
var oldInterpolationMode = pe.Graphics.InterpolationMode;
|
||||
if (Quality > 1)
|
||||
{
|
||||
pe.Graphics.CompositingMode = CompositingMode.SourceCopy;
|
||||
pe.Graphics.CompositingQuality = CompositingQuality.HighSpeed;
|
||||
}
|
||||
|
||||
pe.Graphics.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||
pe.Graphics.DrawImage(mapImage, 0, 0);
|
||||
|
||||
pe.Graphics.CompositingMode = oldCompositingMode;
|
||||
pe.Graphics.CompositingQuality = oldCompositingQuality;
|
||||
pe.Graphics.InterpolationMode = oldInterpolationMode;
|
||||
}
|
||||
|
||||
PostRender?.Invoke(this, new RenderEventArgs(pe.Graphics, fullInvalidation ? null : invalidateCells));
|
||||
|
||||
#if DEVELOPER
|
||||
if (Globals.Developer.ShowOverlapCells)
|
||||
{
|
||||
var invalidPen = new Pen(Color.DarkRed);
|
||||
foreach (var cell in invalidateCells)
|
||||
{
|
||||
pe.Graphics.DrawRectangle(invalidPen, new Rectangle(cell.X * Globals.TileWidth, cell.Y * Globals.TileHeight, Globals.TileWidth, Globals.TileHeight));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
invalidateCells.Clear();
|
||||
fullInvalidation = false;
|
||||
}
|
||||
|
||||
private void UpdateCamera()
|
||||
{
|
||||
if (mapImage == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (ClientSize.IsEmpty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
updatingCamera = true;
|
||||
|
||||
var mapAspect = (double)mapImage.Width / mapImage.Height;
|
||||
var panelAspect = (double)ClientSize.Width / ClientSize.Height;
|
||||
var cameraLocation = cameraBounds.Location;
|
||||
|
||||
var size = Size.Empty;
|
||||
if (panelAspect > mapAspect)
|
||||
{
|
||||
size.Height = mapImage.Height / zoom;
|
||||
size.Width = (int)(size.Height * panelAspect);
|
||||
}
|
||||
else
|
||||
{
|
||||
size.Width = mapImage.Width / zoom;
|
||||
size.Height = (int)(size.Width / panelAspect);
|
||||
}
|
||||
|
||||
var location = Point.Empty;
|
||||
var scrollSize = Size.Empty;
|
||||
if (size.Width < mapImage.Width)
|
||||
{
|
||||
location.X = Math.Max(0, Math.Min(mapImage.Width - size.Width, cameraBounds.Left));
|
||||
scrollSize.Width = mapImage.Width * ClientSize.Width / size.Width;
|
||||
}
|
||||
else
|
||||
{
|
||||
location.X = (mapImage.Width - size.Width) / 2;
|
||||
}
|
||||
|
||||
if (size.Height < mapImage.Height)
|
||||
{
|
||||
location.Y = Math.Max(0, Math.Min(mapImage.Height - size.Height, cameraBounds.Top));
|
||||
scrollSize.Height = mapImage.Height * ClientSize.Height / size.Height;
|
||||
}
|
||||
else
|
||||
{
|
||||
location.Y = (mapImage.Height - size.Height) / 2;
|
||||
}
|
||||
|
||||
cameraBounds = new Rectangle(location, size);
|
||||
RecalculateTransforms();
|
||||
|
||||
if (referencePositions.HasValue)
|
||||
{
|
||||
var mapPoint = referencePositions.Value.map;
|
||||
var clientSize = referencePositions.Value.client;
|
||||
|
||||
cameraLocation = cameraBounds.Location;
|
||||
if (scrollSize.Width != 0)
|
||||
{
|
||||
cameraLocation.X = Math.Max(0, Math.Min(mapImage.Width - cameraBounds.Width, (int)(mapPoint.X - (cameraBounds.Width * clientSize.Width))));
|
||||
}
|
||||
if (scrollSize.Height != 0)
|
||||
{
|
||||
cameraLocation.Y = Math.Max(0, Math.Min(mapImage.Height - cameraBounds.Height, (int)(mapPoint.Y - (cameraBounds.Height * clientSize.Height))));
|
||||
}
|
||||
if (!scrollSize.IsEmpty)
|
||||
{
|
||||
cameraBounds.Location = cameraLocation;
|
||||
RecalculateTransforms();
|
||||
}
|
||||
|
||||
referencePositions = null;
|
||||
}
|
||||
|
||||
SuspendDrawing();
|
||||
AutoScrollMinSize = scrollSize;
|
||||
AutoScrollPosition = (Point)MapToClient((Size)cameraBounds.Location);
|
||||
lastScrollPosition = AutoScrollPosition;
|
||||
ResumeDrawing();
|
||||
|
||||
updatingCamera = false;
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
private void RecalculateTransforms()
|
||||
{
|
||||
mapToViewTransform.Reset();
|
||||
mapToViewTransform.Translate(cameraBounds.Left, cameraBounds.Top);
|
||||
mapToViewTransform.Scale(cameraBounds.Width, cameraBounds.Height);
|
||||
mapToViewTransform.Invert();
|
||||
|
||||
viewToPageTransform.Reset();
|
||||
viewToPageTransform.Scale(ClientSize.Width, ClientSize.Height);
|
||||
|
||||
compositeTransform.Reset();
|
||||
compositeTransform.Multiply(viewToPageTransform);
|
||||
compositeTransform.Multiply(mapToViewTransform);
|
||||
|
||||
invCompositeTransform.Reset();
|
||||
invCompositeTransform.Multiply(compositeTransform);
|
||||
invCompositeTransform.Invert();
|
||||
}
|
||||
|
||||
private void InvalidateScroll()
|
||||
{
|
||||
if (updatingCamera)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ((lastScrollPosition.X != AutoScrollPosition.X) || (lastScrollPosition.Y != AutoScrollPosition.Y))
|
||||
{
|
||||
var delta = ClientToMap((Size)(lastScrollPosition - (Size)AutoScrollPosition));
|
||||
lastScrollPosition = AutoScrollPosition;
|
||||
|
||||
var cameraLocation = cameraBounds.Location;
|
||||
if (AutoScrollMinSize.Width != 0)
|
||||
{
|
||||
cameraLocation.X = Math.Max(0, Math.Min(mapImage.Width - cameraBounds.Width, cameraBounds.Left + delta.Width));
|
||||
}
|
||||
if (AutoScrollMinSize.Height != 0)
|
||||
{
|
||||
cameraLocation.Y = Math.Max(0, Math.Min(mapImage.Height - cameraBounds.Height, cameraBounds.Top + delta.Height));
|
||||
}
|
||||
if (!AutoScrollMinSize.IsEmpty)
|
||||
{
|
||||
cameraBounds.Location = cameraLocation;
|
||||
RecalculateTransforms();
|
||||
}
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern int SendMessage(IntPtr hWnd, Int32 wMsg, bool wParam, Int32 lParam);
|
||||
|
||||
private const int WM_SETREDRAW = 11;
|
||||
|
||||
private void SuspendDrawing()
|
||||
{
|
||||
SendMessage(Handle, WM_SETREDRAW, false, 0);
|
||||
}
|
||||
|
||||
private void ResumeDrawing()
|
||||
{
|
||||
SendMessage(Handle, WM_SETREDRAW, true, 0);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -0,0 +1,50 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
partial class MenuButton
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
public partial class MenuButton : Button
|
||||
{
|
||||
public const int DefaultSplitWidth = 20;
|
||||
|
||||
[DefaultValue(null), Browsable(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
public ContextMenuStrip Menu { get; set; }
|
||||
|
||||
[DefaultValue(DefaultSplitWidth), Browsable(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
public int SplitWidth { get; set; } = DefaultSplitWidth;
|
||||
|
||||
public MenuButton()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnMouseDown(MouseEventArgs mevent)
|
||||
{
|
||||
var splitRect = new Rectangle(Width - SplitWidth, 0, SplitWidth, Height);
|
||||
|
||||
if ((Menu != null) && (mevent.Button == MouseButtons.Left) && splitRect.Contains(mevent.Location))
|
||||
{
|
||||
Menu.Show(this, 0, Height);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.OnMouseDown(mevent);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs pevent)
|
||||
{
|
||||
base.OnPaint(pevent);
|
||||
|
||||
if ((Menu != null) && (SplitWidth > 0))
|
||||
{
|
||||
int arrowX = ClientRectangle.Width - 14;
|
||||
int arrowY = ClientRectangle.Height / 2 - 1;
|
||||
|
||||
var arrowBrush = Enabled ? SystemBrushes.ControlText : SystemBrushes.ButtonShadow;
|
||||
var arrows = new[] { new Point(arrowX, arrowY), new Point(arrowX + 7, arrowY), new Point(arrowX + 3, arrowY + 4) };
|
||||
pevent.Graphics.FillPolygon(arrowBrush, arrows);
|
||||
|
||||
int lineX = ClientRectangle.Width - SplitWidth;
|
||||
int lineYFrom = arrowY - 4;
|
||||
int lineYTo = arrowY + 8;
|
||||
using (var separatorPen = new Pen(Brushes.DarkGray) { DashStyle = DashStyle.Dot })
|
||||
{
|
||||
pevent.Graphics.DrawLine(separatorPen, lineX, lineYFrom, lineX, lineYTo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,345 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
partial class ObjectProperties
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.directionLabel = new System.Windows.Forms.Label();
|
||||
this.missionLabel = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.houseComboBox = new MobiusEditor.Controls.PropertiesComboBox();
|
||||
this.strengthNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.directionComboBox = new MobiusEditor.Controls.PropertiesComboBox();
|
||||
this.missionComboBox = new MobiusEditor.Controls.PropertiesComboBox();
|
||||
this.triggerComboBox = new MobiusEditor.Controls.PropertiesComboBox();
|
||||
this.basePriorityNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.prebuiltCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.basePriorityLabel = new System.Windows.Forms.Label();
|
||||
this.sellableCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.rebuildCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.strengthNud)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.basePriorityNud)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 31.25F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 68.75F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.directionLabel, 0, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.missionLabel, 0, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label5, 0, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.houseComboBox, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.strengthNud, 1, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.directionComboBox, 1, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.missionComboBox, 1, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.triggerComboBox, 1, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.basePriorityNud, 1, 5);
|
||||
this.tableLayoutPanel1.Controls.Add(this.prebuiltCheckBox, 1, 7);
|
||||
this.tableLayoutPanel1.Controls.Add(this.basePriorityLabel, 0, 5);
|
||||
this.tableLayoutPanel1.Controls.Add(this.sellableCheckBox, 1, 8);
|
||||
this.tableLayoutPanel1.Controls.Add(this.rebuildCheckBox, 1, 9);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 11;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(299, 262);
|
||||
this.tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label1.Location = new System.Drawing.Point(4, 0);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(85, 32);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "House";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label2.Location = new System.Drawing.Point(4, 32);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(85, 30);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "Strength";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// directionLabel
|
||||
//
|
||||
this.directionLabel.AutoSize = true;
|
||||
this.directionLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.directionLabel.Location = new System.Drawing.Point(4, 62);
|
||||
this.directionLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.directionLabel.Name = "directionLabel";
|
||||
this.directionLabel.Size = new System.Drawing.Size(85, 32);
|
||||
this.directionLabel.TabIndex = 2;
|
||||
this.directionLabel.Text = "Direction";
|
||||
this.directionLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// missionLabel
|
||||
//
|
||||
this.missionLabel.AutoSize = true;
|
||||
this.missionLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.missionLabel.Location = new System.Drawing.Point(4, 94);
|
||||
this.missionLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.missionLabel.Name = "missionLabel";
|
||||
this.missionLabel.Size = new System.Drawing.Size(85, 32);
|
||||
this.missionLabel.TabIndex = 3;
|
||||
this.missionLabel.Text = "Mission";
|
||||
this.missionLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label5.Location = new System.Drawing.Point(4, 126);
|
||||
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(85, 32);
|
||||
this.label5.TabIndex = 4;
|
||||
this.label5.Text = "Trigger";
|
||||
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// houseComboBox
|
||||
//
|
||||
this.houseComboBox.DisplayMember = "Name";
|
||||
this.houseComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.houseComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.houseComboBox.FormattingEnabled = true;
|
||||
this.houseComboBox.Location = new System.Drawing.Point(97, 4);
|
||||
this.houseComboBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.houseComboBox.Name = "houseComboBox";
|
||||
this.houseComboBox.Size = new System.Drawing.Size(198, 24);
|
||||
this.houseComboBox.TabIndex = 5;
|
||||
this.houseComboBox.ValueMember = "Type";
|
||||
this.houseComboBox.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedValueChanged);
|
||||
//
|
||||
// strengthNud
|
||||
//
|
||||
this.strengthNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.strengthNud.Location = new System.Drawing.Point(97, 36);
|
||||
this.strengthNud.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.strengthNud.Maximum = new decimal(new int[] {
|
||||
256,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.strengthNud.Minimum = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.strengthNud.Name = "strengthNud";
|
||||
this.strengthNud.Size = new System.Drawing.Size(198, 22);
|
||||
this.strengthNud.TabIndex = 6;
|
||||
this.strengthNud.Value = new decimal(new int[] {
|
||||
256,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.strengthNud.ValueChanged += new System.EventHandler(this.nud_ValueChanged);
|
||||
//
|
||||
// directionComboBox
|
||||
//
|
||||
this.directionComboBox.DisplayMember = "Name";
|
||||
this.directionComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.directionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.directionComboBox.FormattingEnabled = true;
|
||||
this.directionComboBox.Location = new System.Drawing.Point(97, 66);
|
||||
this.directionComboBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.directionComboBox.Name = "directionComboBox";
|
||||
this.directionComboBox.Size = new System.Drawing.Size(198, 24);
|
||||
this.directionComboBox.TabIndex = 7;
|
||||
this.directionComboBox.ValueMember = "Type";
|
||||
this.directionComboBox.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedValueChanged);
|
||||
//
|
||||
// missionComboBox
|
||||
//
|
||||
this.missionComboBox.DisplayMember = "Name";
|
||||
this.missionComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.missionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.missionComboBox.FormattingEnabled = true;
|
||||
this.missionComboBox.Location = new System.Drawing.Point(97, 98);
|
||||
this.missionComboBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.missionComboBox.Name = "missionComboBox";
|
||||
this.missionComboBox.Size = new System.Drawing.Size(198, 24);
|
||||
this.missionComboBox.TabIndex = 8;
|
||||
this.missionComboBox.ValueMember = "Type";
|
||||
this.missionComboBox.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedValueChanged);
|
||||
//
|
||||
// triggerComboBox
|
||||
//
|
||||
this.triggerComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.triggerComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.triggerComboBox.FormattingEnabled = true;
|
||||
this.triggerComboBox.Location = new System.Drawing.Point(97, 130);
|
||||
this.triggerComboBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.triggerComboBox.Name = "triggerComboBox";
|
||||
this.triggerComboBox.Size = new System.Drawing.Size(198, 24);
|
||||
this.triggerComboBox.TabIndex = 9;
|
||||
this.triggerComboBox.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedValueChanged);
|
||||
//
|
||||
// basePriorityNud
|
||||
//
|
||||
this.basePriorityNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.basePriorityNud.Location = new System.Drawing.Point(96, 160);
|
||||
this.basePriorityNud.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.basePriorityNud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.basePriorityNud.Minimum = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
this.basePriorityNud.Name = "basePriorityNud";
|
||||
this.basePriorityNud.Size = new System.Drawing.Size(200, 22);
|
||||
this.basePriorityNud.TabIndex = 11;
|
||||
this.basePriorityNud.ValueChanged += new System.EventHandler(this.nud_ValueChanged);
|
||||
//
|
||||
// prebuiltCheckBox
|
||||
//
|
||||
this.prebuiltCheckBox.AutoSize = true;
|
||||
this.prebuiltCheckBox.Location = new System.Drawing.Point(96, 186);
|
||||
this.prebuiltCheckBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.prebuiltCheckBox.Name = "prebuiltCheckBox";
|
||||
this.prebuiltCheckBox.Size = new System.Drawing.Size(78, 21);
|
||||
this.prebuiltCheckBox.TabIndex = 12;
|
||||
this.prebuiltCheckBox.Text = "Prebuilt";
|
||||
this.prebuiltCheckBox.UseVisualStyleBackColor = true;
|
||||
this.prebuiltCheckBox.CheckedChanged += new System.EventHandler(this.checkBox_CheckedChanged);
|
||||
//
|
||||
// basePriorityLabel
|
||||
//
|
||||
this.basePriorityLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.basePriorityLabel.Location = new System.Drawing.Point(3, 158);
|
||||
this.basePriorityLabel.Name = "basePriorityLabel";
|
||||
this.basePriorityLabel.Size = new System.Drawing.Size(87, 26);
|
||||
this.basePriorityLabel.TabIndex = 13;
|
||||
this.basePriorityLabel.Text = "Base Priority";
|
||||
this.basePriorityLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// sellableCheckBox
|
||||
//
|
||||
this.sellableCheckBox.AutoSize = true;
|
||||
this.sellableCheckBox.Location = new System.Drawing.Point(96, 211);
|
||||
this.sellableCheckBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.sellableCheckBox.Name = "sellableCheckBox";
|
||||
this.sellableCheckBox.Size = new System.Drawing.Size(80, 21);
|
||||
this.sellableCheckBox.TabIndex = 14;
|
||||
this.sellableCheckBox.Text = "Sellable";
|
||||
this.sellableCheckBox.UseVisualStyleBackColor = true;
|
||||
this.sellableCheckBox.CheckedChanged += new System.EventHandler(this.checkBox_CheckedChanged);
|
||||
//
|
||||
// rebuildCheckBox
|
||||
//
|
||||
this.rebuildCheckBox.AutoSize = true;
|
||||
this.rebuildCheckBox.Location = new System.Drawing.Point(96, 236);
|
||||
this.rebuildCheckBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.rebuildCheckBox.Name = "rebuildCheckBox";
|
||||
this.rebuildCheckBox.Size = new System.Drawing.Size(78, 21);
|
||||
this.rebuildCheckBox.TabIndex = 15;
|
||||
this.rebuildCheckBox.Text = "Rebuild";
|
||||
this.rebuildCheckBox.UseVisualStyleBackColor = true;
|
||||
this.rebuildCheckBox.CheckedChanged += new System.EventHandler(this.checkBox_CheckedChanged);
|
||||
//
|
||||
// ObjectProperties
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.Name = "ObjectProperties";
|
||||
this.Size = new System.Drawing.Size(299, 262);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.strengthNud)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.basePriorityNud)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label directionLabel;
|
||||
private System.Windows.Forms.Label missionLabel;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private MobiusEditor.Controls.PropertiesComboBox houseComboBox;
|
||||
private System.Windows.Forms.NumericUpDown strengthNud;
|
||||
private MobiusEditor.Controls.PropertiesComboBox directionComboBox;
|
||||
private MobiusEditor.Controls.PropertiesComboBox missionComboBox;
|
||||
private MobiusEditor.Controls.PropertiesComboBox triggerComboBox;
|
||||
private System.Windows.Forms.NumericUpDown basePriorityNud;
|
||||
private System.Windows.Forms.CheckBox prebuiltCheckBox;
|
||||
private System.Windows.Forms.Label basePriorityLabel;
|
||||
private System.Windows.Forms.CheckBox sellableCheckBox;
|
||||
private System.Windows.Forms.CheckBox rebuildCheckBox;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,272 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Model;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
public partial class ObjectProperties : UserControl
|
||||
{
|
||||
private bool isMockObject;
|
||||
|
||||
public IGamePlugin Plugin { get; private set; }
|
||||
|
||||
private INotifyPropertyChanged obj;
|
||||
public INotifyPropertyChanged Object
|
||||
{
|
||||
get => obj;
|
||||
set
|
||||
{
|
||||
if (obj != value)
|
||||
{
|
||||
if (obj != null)
|
||||
{
|
||||
obj.PropertyChanged -= Obj_PropertyChanged;
|
||||
}
|
||||
|
||||
obj = value;
|
||||
|
||||
if (obj != null)
|
||||
{
|
||||
obj.PropertyChanged += Obj_PropertyChanged;
|
||||
}
|
||||
|
||||
Rebind();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ObjectProperties()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void Initialize(IGamePlugin plugin, bool isMockObject)
|
||||
{
|
||||
this.isMockObject = isMockObject;
|
||||
|
||||
Plugin = plugin;
|
||||
plugin.Map.Triggers.CollectionChanged += Triggers_CollectionChanged;
|
||||
|
||||
houseComboBox.DataSource = plugin.Map.Houses.Select(t => new TypeItem<HouseType>(t.Type.Name, t.Type)).ToArray();
|
||||
missionComboBox.DataSource = plugin.Map.MissionTypes;
|
||||
|
||||
UpdateDataSource();
|
||||
|
||||
Disposed += (sender, e) =>
|
||||
{
|
||||
Object = null;
|
||||
plugin.Map.Triggers.CollectionChanged -= Triggers_CollectionChanged;
|
||||
};
|
||||
}
|
||||
|
||||
private void Triggers_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
UpdateDataSource();
|
||||
}
|
||||
|
||||
private void UpdateDataSource()
|
||||
{
|
||||
triggerComboBox.DataSource = Trigger.None.Yield().Concat(Plugin.Map.Triggers.Select(t => t.Name).Distinct()).ToArray();
|
||||
}
|
||||
|
||||
private void Rebind()
|
||||
{
|
||||
houseComboBox.DataBindings.Clear();
|
||||
strengthNud.DataBindings.Clear();
|
||||
directionComboBox.DataBindings.Clear();
|
||||
missionComboBox.DataBindings.Clear();
|
||||
triggerComboBox.DataBindings.Clear();
|
||||
basePriorityNud.DataBindings.Clear();
|
||||
prebuiltCheckBox.DataBindings.Clear();
|
||||
sellableCheckBox.DataBindings.Clear();
|
||||
rebuildCheckBox.DataBindings.Clear();
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (obj)
|
||||
{
|
||||
case Infantry infantry:
|
||||
{
|
||||
houseComboBox.Enabled = true;
|
||||
directionComboBox.DataSource = Plugin.Map.DirectionTypes
|
||||
.Where(t => t.Facing != FacingType.None)
|
||||
.Select(t => new TypeItem<DirectionType>(t.Name, t)).ToArray();
|
||||
|
||||
missionComboBox.DataBindings.Add("SelectedItem", obj, "Mission");
|
||||
missionLabel.Visible = missionComboBox.Visible = true;
|
||||
basePriorityLabel.Visible = basePriorityNud.Visible = false;
|
||||
prebuiltCheckBox.Visible = false;
|
||||
sellableCheckBox.Visible = false;
|
||||
rebuildCheckBox.Visible = false;
|
||||
}
|
||||
break;
|
||||
case Unit unit:
|
||||
{
|
||||
houseComboBox.Enabled = true;
|
||||
directionComboBox.DataSource = Plugin.Map.DirectionTypes.Select(t => new TypeItem<DirectionType>(t.Name, t)).ToArray();
|
||||
missionComboBox.DataBindings.Add("SelectedItem", obj, "Mission");
|
||||
missionLabel.Visible = missionComboBox.Visible = true;
|
||||
basePriorityLabel.Visible = basePriorityNud.Visible = false;
|
||||
prebuiltCheckBox.Visible = false;
|
||||
sellableCheckBox.Visible = false;
|
||||
rebuildCheckBox.Visible = false;
|
||||
}
|
||||
break;
|
||||
case Building building:
|
||||
{
|
||||
houseComboBox.Enabled = building.IsPrebuilt;
|
||||
directionComboBox.DataSource = Plugin.Map.DirectionTypes.Select(t => new TypeItem<DirectionType>(t.Name, t)).ToArray();
|
||||
directionComboBox.Visible = (building.Type != null) && building.Type.HasTurret;
|
||||
missionLabel.Visible = missionComboBox.Visible = false;
|
||||
basePriorityLabel.Visible = basePriorityNud.Visible = true;
|
||||
prebuiltCheckBox.Visible = true;
|
||||
prebuiltCheckBox.Enabled = building.BasePriority >= 0;
|
||||
|
||||
basePriorityNud.DataBindings.Add("Value", obj, "BasePriority");
|
||||
prebuiltCheckBox.DataBindings.Add("Checked", obj, "IsPrebuilt");
|
||||
|
||||
switch (Plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
{
|
||||
sellableCheckBox.Visible = false;
|
||||
rebuildCheckBox.Visible = false;
|
||||
} break;
|
||||
case GameType.RedAlert:
|
||||
{
|
||||
sellableCheckBox.DataBindings.Add("Checked", obj, "Sellable");
|
||||
rebuildCheckBox.DataBindings.Add("Checked", obj, "Rebuild");
|
||||
sellableCheckBox.Visible = true;
|
||||
rebuildCheckBox.Visible = true;
|
||||
} break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
houseComboBox.DataBindings.Add("SelectedValue", obj, "House");
|
||||
strengthNud.DataBindings.Add("Value", obj, "Strength");
|
||||
directionComboBox.DataBindings.Add("SelectedValue", obj, "Direction");
|
||||
triggerComboBox.DataBindings.Add("SelectedItem", obj, "Trigger");
|
||||
}
|
||||
|
||||
private void Obj_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
switch (e.PropertyName)
|
||||
{
|
||||
case "Type":
|
||||
{
|
||||
Rebind();
|
||||
}
|
||||
break;
|
||||
case "BasePriority":
|
||||
{
|
||||
if (obj is Building building)
|
||||
{
|
||||
prebuiltCheckBox.Enabled = building.BasePriority >= 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "IsPrebuilt":
|
||||
{
|
||||
if (obj is Building building)
|
||||
{
|
||||
if (!building.IsPrebuilt)
|
||||
{
|
||||
var basePlayer = Plugin.Map.HouseTypes.Where(h => h.Equals(Plugin.Map.BasicSection.BasePlayer)).FirstOrDefault() ?? Plugin.Map.HouseTypes.First();
|
||||
building.House = basePlayer;
|
||||
}
|
||||
houseComboBox.Enabled = building.IsPrebuilt;
|
||||
}
|
||||
} break;
|
||||
}
|
||||
|
||||
if (!isMockObject)
|
||||
{
|
||||
Plugin.Dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
foreach (Binding binding in (sender as ComboBox).DataBindings)
|
||||
{
|
||||
binding.WriteValue();
|
||||
}
|
||||
}
|
||||
|
||||
private void nud_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
foreach (Binding binding in (sender as NumericUpDown).DataBindings)
|
||||
{
|
||||
binding.WriteValue();
|
||||
}
|
||||
}
|
||||
|
||||
private void checkBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
foreach (Binding binding in (sender as CheckBox).DataBindings)
|
||||
{
|
||||
binding.WriteValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ObjectPropertiesPopup : ToolStripDropDown
|
||||
{
|
||||
private readonly ToolStripControlHost host;
|
||||
|
||||
public ObjectProperties ObjectProperties { get; private set; }
|
||||
|
||||
public ObjectPropertiesPopup(IGamePlugin plugin, INotifyPropertyChanged obj)
|
||||
{
|
||||
ObjectProperties = new ObjectProperties();
|
||||
ObjectProperties.Initialize(plugin, false);
|
||||
ObjectProperties.Object = obj;
|
||||
|
||||
host = new ToolStripControlHost(ObjectProperties);
|
||||
Padding = Margin = host.Padding = host.Margin = Padding.Empty;
|
||||
MinimumSize = ObjectProperties.MinimumSize;
|
||||
ObjectProperties.MinimumSize = ObjectProperties.Size;
|
||||
MaximumSize = ObjectProperties.MaximumSize;
|
||||
ObjectProperties.MaximumSize = ObjectProperties.Size;
|
||||
Size = ObjectProperties.Size;
|
||||
Items.Add(host);
|
||||
ObjectProperties.Disposed += (sender, e) =>
|
||||
{
|
||||
ObjectProperties = null;
|
||||
Dispose(true);
|
||||
};
|
||||
}
|
||||
|
||||
protected override void OnClosed(ToolStripDropDownClosedEventArgs e)
|
||||
{
|
||||
base.OnClosed(e);
|
||||
|
||||
ObjectProperties.Object = null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -0,0 +1,375 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
partial class PlayerSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.iqNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.techLevelNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.maxVesselsNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.maxInfantryNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.iqLbl = new System.Windows.Forms.Label();
|
||||
this.techLevelLbl = new System.Windows.Forms.Label();
|
||||
this.maxVesselsLbl = new System.Windows.Forms.Label();
|
||||
this.maxInfantryLbl = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.edgeComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.creditsNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.maxBuildingsNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.maxUnitsNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.playersListBox = new System.Windows.Forms.ListBox();
|
||||
this.playerControlLbl = new System.Windows.Forms.Label();
|
||||
this.playerControlCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.iqNud)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.techLevelNud)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.maxVesselsNud)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.maxInfantryNud)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.creditsNud)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.maxBuildingsNud)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.maxUnitsNud)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.AutoSize = true;
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel1.Controls.Add(this.playerControlLbl, 0, 8);
|
||||
this.tableLayoutPanel1.Controls.Add(this.iqNud, 1, 7);
|
||||
this.tableLayoutPanel1.Controls.Add(this.techLevelNud, 1, 6);
|
||||
this.tableLayoutPanel1.Controls.Add(this.maxVesselsNud, 1, 5);
|
||||
this.tableLayoutPanel1.Controls.Add(this.maxInfantryNud, 1, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.iqLbl, 0, 7);
|
||||
this.tableLayoutPanel1.Controls.Add(this.techLevelLbl, 0, 6);
|
||||
this.tableLayoutPanel1.Controls.Add(this.maxVesselsLbl, 0, 5);
|
||||
this.tableLayoutPanel1.Controls.Add(this.maxInfantryLbl, 0, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.edgeComboBox, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.creditsNud, 1, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label3, 0, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label4, 0, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.maxBuildingsNud, 1, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.maxUnitsNud, 1, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label5, 0, 9);
|
||||
this.tableLayoutPanel1.Controls.Add(this.playersListBox, 1, 9);
|
||||
this.tableLayoutPanel1.Controls.Add(this.playerControlCheckBox, 1, 8);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 10;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(329, 372);
|
||||
this.tableLayoutPanel1.TabIndex = 2;
|
||||
//
|
||||
// iqNud
|
||||
//
|
||||
this.iqNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.iqNud.Location = new System.Drawing.Point(81, 186);
|
||||
this.iqNud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.iqNud.Name = "iqNud";
|
||||
this.iqNud.Size = new System.Drawing.Size(245, 20);
|
||||
this.iqNud.TabIndex = 26;
|
||||
//
|
||||
// techLevelNud
|
||||
//
|
||||
this.techLevelNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.techLevelNud.Location = new System.Drawing.Point(81, 160);
|
||||
this.techLevelNud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.techLevelNud.Name = "techLevelNud";
|
||||
this.techLevelNud.Size = new System.Drawing.Size(245, 20);
|
||||
this.techLevelNud.TabIndex = 25;
|
||||
//
|
||||
// maxVesselsNud
|
||||
//
|
||||
this.maxVesselsNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.maxVesselsNud.Location = new System.Drawing.Point(81, 134);
|
||||
this.maxVesselsNud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.maxVesselsNud.Name = "maxVesselsNud";
|
||||
this.maxVesselsNud.Size = new System.Drawing.Size(245, 20);
|
||||
this.maxVesselsNud.TabIndex = 24;
|
||||
//
|
||||
// maxInfantryNud
|
||||
//
|
||||
this.maxInfantryNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.maxInfantryNud.Location = new System.Drawing.Point(81, 108);
|
||||
this.maxInfantryNud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.maxInfantryNud.Name = "maxInfantryNud";
|
||||
this.maxInfantryNud.Size = new System.Drawing.Size(245, 20);
|
||||
this.maxInfantryNud.TabIndex = 23;
|
||||
//
|
||||
// iqLbl
|
||||
//
|
||||
this.iqLbl.AutoSize = true;
|
||||
this.iqLbl.Location = new System.Drawing.Point(3, 183);
|
||||
this.iqLbl.Name = "iqLbl";
|
||||
this.iqLbl.Size = new System.Drawing.Size(18, 13);
|
||||
this.iqLbl.TabIndex = 22;
|
||||
this.iqLbl.Text = "IQ";
|
||||
//
|
||||
// techLevelLbl
|
||||
//
|
||||
this.techLevelLbl.AutoSize = true;
|
||||
this.techLevelLbl.Location = new System.Drawing.Point(3, 157);
|
||||
this.techLevelLbl.Name = "techLevelLbl";
|
||||
this.techLevelLbl.Size = new System.Drawing.Size(61, 13);
|
||||
this.techLevelLbl.TabIndex = 21;
|
||||
this.techLevelLbl.Text = "Tech Level";
|
||||
//
|
||||
// maxVesselsLbl
|
||||
//
|
||||
this.maxVesselsLbl.AutoSize = true;
|
||||
this.maxVesselsLbl.Location = new System.Drawing.Point(3, 131);
|
||||
this.maxVesselsLbl.Name = "maxVesselsLbl";
|
||||
this.maxVesselsLbl.Size = new System.Drawing.Size(66, 13);
|
||||
this.maxVesselsLbl.TabIndex = 20;
|
||||
this.maxVesselsLbl.Text = "Max Vessels";
|
||||
//
|
||||
// maxInfantryLbl
|
||||
//
|
||||
this.maxInfantryLbl.AutoSize = true;
|
||||
this.maxInfantryLbl.Location = new System.Drawing.Point(3, 105);
|
||||
this.maxInfantryLbl.Name = "maxInfantryLbl";
|
||||
this.maxInfantryLbl.Size = new System.Drawing.Size(65, 13);
|
||||
this.maxInfantryLbl.TabIndex = 19;
|
||||
this.maxInfantryLbl.Text = "Max Infantry";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(3, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(32, 13);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Edge";
|
||||
//
|
||||
// edgeComboBox
|
||||
//
|
||||
this.edgeComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.edgeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.edgeComboBox.FormattingEnabled = true;
|
||||
this.edgeComboBox.Location = new System.Drawing.Point(81, 3);
|
||||
this.edgeComboBox.Name = "edgeComboBox";
|
||||
this.edgeComboBox.Size = new System.Drawing.Size(245, 21);
|
||||
this.edgeComboBox.TabIndex = 10;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(3, 27);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(39, 13);
|
||||
this.label2.TabIndex = 11;
|
||||
this.label2.Text = "Credits";
|
||||
//
|
||||
// creditsNud
|
||||
//
|
||||
this.creditsNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.creditsNud.Location = new System.Drawing.Point(81, 30);
|
||||
this.creditsNud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.creditsNud.Name = "creditsNud";
|
||||
this.creditsNud.Size = new System.Drawing.Size(245, 20);
|
||||
this.creditsNud.TabIndex = 12;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(3, 53);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(72, 13);
|
||||
this.label3.TabIndex = 13;
|
||||
this.label3.Text = "Max Buildings";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(3, 79);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(54, 13);
|
||||
this.label4.TabIndex = 14;
|
||||
this.label4.Text = "Max Units";
|
||||
//
|
||||
// maxBuildingsNud
|
||||
//
|
||||
this.maxBuildingsNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.maxBuildingsNud.Location = new System.Drawing.Point(81, 56);
|
||||
this.maxBuildingsNud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.maxBuildingsNud.Name = "maxBuildingsNud";
|
||||
this.maxBuildingsNud.Size = new System.Drawing.Size(245, 20);
|
||||
this.maxBuildingsNud.TabIndex = 15;
|
||||
//
|
||||
// maxUnitsNud
|
||||
//
|
||||
this.maxUnitsNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.maxUnitsNud.Location = new System.Drawing.Point(81, 82);
|
||||
this.maxUnitsNud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.maxUnitsNud.Name = "maxUnitsNud";
|
||||
this.maxUnitsNud.Size = new System.Drawing.Size(245, 20);
|
||||
this.maxUnitsNud.TabIndex = 16;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(3, 229);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(31, 13);
|
||||
this.label5.TabIndex = 17;
|
||||
this.label5.Text = "Allies";
|
||||
//
|
||||
// playersListBox
|
||||
//
|
||||
this.playersListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.playersListBox.FormattingEnabled = true;
|
||||
this.playersListBox.Location = new System.Drawing.Point(81, 232);
|
||||
this.playersListBox.Name = "playersListBox";
|
||||
this.playersListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple;
|
||||
this.playersListBox.Size = new System.Drawing.Size(100, 134);
|
||||
this.playersListBox.TabIndex = 18;
|
||||
//
|
||||
// playerControlLbl
|
||||
//
|
||||
this.playerControlLbl.AutoSize = true;
|
||||
this.playerControlLbl.Location = new System.Drawing.Point(3, 209);
|
||||
this.playerControlLbl.Name = "playerControlLbl";
|
||||
this.playerControlLbl.Size = new System.Drawing.Size(72, 13);
|
||||
this.playerControlLbl.TabIndex = 27;
|
||||
this.playerControlLbl.Text = "Player Control";
|
||||
//
|
||||
// playerControlCheckBox
|
||||
//
|
||||
this.playerControlCheckBox.AutoSize = true;
|
||||
this.playerControlCheckBox.Location = new System.Drawing.Point(81, 212);
|
||||
this.playerControlCheckBox.Name = "playerControlCheckBox";
|
||||
this.playerControlCheckBox.Size = new System.Drawing.Size(15, 14);
|
||||
this.playerControlCheckBox.TabIndex = 28;
|
||||
this.playerControlCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// PlayerSettings
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Name = "PlayerSettings";
|
||||
this.Size = new System.Drawing.Size(329, 372);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.iqNud)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.techLevelNud)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.maxVesselsNud)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.maxInfantryNud)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.creditsNud)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.maxBuildingsNud)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.maxUnitsNud)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox edgeComboBox;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.NumericUpDown creditsNud;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.NumericUpDown maxBuildingsNud;
|
||||
private System.Windows.Forms.NumericUpDown maxUnitsNud;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.ListBox playersListBox;
|
||||
private System.Windows.Forms.Label techLevelLbl;
|
||||
private System.Windows.Forms.Label maxVesselsLbl;
|
||||
private System.Windows.Forms.Label maxInfantryLbl;
|
||||
private System.Windows.Forms.Label iqLbl;
|
||||
private System.Windows.Forms.NumericUpDown maxVesselsNud;
|
||||
private System.Windows.Forms.NumericUpDown maxInfantryNud;
|
||||
private System.Windows.Forms.NumericUpDown iqNud;
|
||||
private System.Windows.Forms.NumericUpDown techLevelNud;
|
||||
private System.Windows.Forms.Label playerControlLbl;
|
||||
private System.Windows.Forms.CheckBox playerControlCheckBox;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Model;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
public partial class PlayerSettings : UserControl
|
||||
{
|
||||
private readonly PropertyTracker<House> houseSettingsTracker;
|
||||
private readonly dynamic house;
|
||||
|
||||
public PlayerSettings(IGamePlugin plugin, PropertyTracker<House> houseSettingsTracker)
|
||||
{
|
||||
this.houseSettingsTracker = houseSettingsTracker;
|
||||
house = houseSettingsTracker;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
edgeComboBox.Items.Clear();
|
||||
edgeComboBox.Items.AddRange(new string[] { "North", "South", "West", "East" });
|
||||
|
||||
creditsNud.DataBindings.Add("Value", houseSettingsTracker, "Credits");
|
||||
maxBuildingsNud.DataBindings.Add("Value", houseSettingsTracker, "MaxBuilding");
|
||||
maxUnitsNud.DataBindings.Add("Value", houseSettingsTracker, "MaxUnit");
|
||||
edgeComboBox.DataBindings.Add("SelectedItem", houseSettingsTracker, "Edge");
|
||||
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
maxInfantryNud.Visible = maxInfantryLbl.Visible = false;
|
||||
maxVesselsNud.Visible = maxVesselsLbl.Visible = false;
|
||||
techLevelNud.Visible = techLevelLbl.Visible = false;
|
||||
iqNud.Visible = iqLbl.Visible = false;
|
||||
playerControlCheckBox.Visible = playerControlLbl.Visible = false;
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
maxInfantryNud.DataBindings.Add("Value", houseSettingsTracker, "MaxInfantry");
|
||||
maxVesselsNud.DataBindings.Add("Value", houseSettingsTracker, "MaxVessel");
|
||||
techLevelNud.DataBindings.Add("Value", houseSettingsTracker, "TechLevel");
|
||||
iqNud.DataBindings.Add("Value", houseSettingsTracker, "IQ");
|
||||
playerControlCheckBox.DataBindings.Add("Checked", houseSettingsTracker, "PlayerControl");
|
||||
break;
|
||||
}
|
||||
|
||||
playersListBox.Items.Clear();
|
||||
playersListBox.Items.AddRange(plugin.Map.Houses.Select(h => h.Type.Name).ToArray());
|
||||
|
||||
var selectedIndices = new List<int>();
|
||||
foreach (var id in house.Allies)
|
||||
{
|
||||
playersListBox.SetSelected(id, true);
|
||||
}
|
||||
|
||||
playersListBox.SelectedIndexChanged += playersListBox_SelectedIndexChanged;
|
||||
}
|
||||
|
||||
private void playersListBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
var allies = 0;
|
||||
foreach (int selectedIndex in playersListBox.SelectedIndices)
|
||||
{
|
||||
allies |= 1 << selectedIndex;
|
||||
}
|
||||
house.Allies = new AlliesMask(allies);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -0,0 +1,50 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
partial class PropertiesComboBox
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
public partial class PropertiesComboBox : ComboBox
|
||||
{
|
||||
private bool savedAutoClose;
|
||||
|
||||
private ToolStripDropDown DropDownHost
|
||||
{
|
||||
get
|
||||
{
|
||||
var parent = Parent;
|
||||
while ((parent != null) && !(parent is ToolStripDropDown))
|
||||
{
|
||||
parent = parent.Parent;
|
||||
}
|
||||
return parent as ToolStripDropDown;
|
||||
}
|
||||
}
|
||||
|
||||
public PropertiesComboBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnDropDownClosed(EventArgs e)
|
||||
{
|
||||
var dropDownHost = DropDownHost;
|
||||
if (dropDownHost != null)
|
||||
{
|
||||
dropDownHost.AutoClose = savedAutoClose;
|
||||
}
|
||||
|
||||
base.OnDropDownClosed(e);
|
||||
}
|
||||
|
||||
protected override void OnDropDown(EventArgs e)
|
||||
{
|
||||
var dropDownHost = DropDownHost;
|
||||
if (dropDownHost != null)
|
||||
{
|
||||
savedAutoClose = dropDownHost.AutoClose;
|
||||
dropDownHost.AutoClose = false;
|
||||
}
|
||||
|
||||
base.OnDropDown(e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,112 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
partial class TerrainProperties
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.triggerComboBox = new MobiusEditor.Controls.PropertiesComboBox();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 31.25F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 68.75F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.label5, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.triggerComboBox, 1, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 1;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(336, 38);
|
||||
this.tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label5.Location = new System.Drawing.Point(4, 0);
|
||||
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(97, 38);
|
||||
this.label5.TabIndex = 4;
|
||||
this.label5.Text = "Trigger";
|
||||
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// triggerComboBox
|
||||
//
|
||||
this.triggerComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.triggerComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.triggerComboBox.FormattingEnabled = true;
|
||||
this.triggerComboBox.Location = new System.Drawing.Point(109, 5);
|
||||
this.triggerComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.triggerComboBox.Name = "triggerComboBox";
|
||||
this.triggerComboBox.Size = new System.Drawing.Size(223, 28);
|
||||
this.triggerComboBox.TabIndex = 9;
|
||||
this.triggerComboBox.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedValueChanged);
|
||||
//
|
||||
// TriggerProperties
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.Name = "TriggerProperties";
|
||||
this.Size = new System.Drawing.Size(336, 38);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private MobiusEditor.Controls.PropertiesComboBox triggerComboBox;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,158 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Model;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
public partial class TerrainProperties : UserControl
|
||||
{
|
||||
private bool isMockObject;
|
||||
|
||||
public IGamePlugin Plugin { get; private set; }
|
||||
|
||||
private Terrain terrain;
|
||||
public Terrain Terrain
|
||||
{
|
||||
get => terrain;
|
||||
set
|
||||
{
|
||||
if (terrain != value)
|
||||
{
|
||||
terrain = value;
|
||||
Rebind();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public TerrainProperties()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void Initialize(IGamePlugin plugin, bool isMockObject)
|
||||
{
|
||||
this.isMockObject = isMockObject;
|
||||
|
||||
Plugin = plugin;
|
||||
plugin.Map.Triggers.CollectionChanged += Triggers_CollectionChanged;
|
||||
|
||||
UpdateDataSource();
|
||||
|
||||
Disposed += (sender, e) =>
|
||||
{
|
||||
Terrain = null;
|
||||
plugin.Map.Triggers.CollectionChanged -= Triggers_CollectionChanged;
|
||||
};
|
||||
}
|
||||
|
||||
private void Triggers_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
UpdateDataSource();
|
||||
}
|
||||
|
||||
private void UpdateDataSource()
|
||||
{
|
||||
triggerComboBox.DataSource = Trigger.None.Yield().Concat(Plugin.Map.Triggers.Select(t => t.Name).Distinct()).ToArray();
|
||||
}
|
||||
|
||||
private void Rebind()
|
||||
{
|
||||
triggerComboBox.DataBindings.Clear();
|
||||
|
||||
if (terrain == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
triggerComboBox.DataBindings.Add("SelectedItem", terrain, "Trigger");
|
||||
}
|
||||
|
||||
private void Obj_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
switch (e.PropertyName)
|
||||
{
|
||||
case "Type":
|
||||
{
|
||||
Rebind();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (!isMockObject)
|
||||
{
|
||||
Plugin.Dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
foreach (Binding binding in (sender as ComboBox).DataBindings)
|
||||
{
|
||||
binding.WriteValue();
|
||||
}
|
||||
}
|
||||
|
||||
private void nud_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
foreach (Binding binding in (sender as NumericUpDown).DataBindings)
|
||||
{
|
||||
binding.WriteValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class TerrainPropertiesPopup : ToolStripDropDown
|
||||
{
|
||||
private readonly ToolStripControlHost host;
|
||||
|
||||
public TerrainProperties TerrainProperties { get; private set; }
|
||||
|
||||
public TerrainPropertiesPopup(IGamePlugin plugin, Terrain terrain)
|
||||
{
|
||||
TerrainProperties = new TerrainProperties();
|
||||
TerrainProperties.Initialize(plugin, false);
|
||||
TerrainProperties.Terrain = terrain;
|
||||
|
||||
host = new ToolStripControlHost(TerrainProperties);
|
||||
Padding = Margin = host.Padding = host.Margin = Padding.Empty;
|
||||
MinimumSize = TerrainProperties.MinimumSize;
|
||||
TerrainProperties.MinimumSize = TerrainProperties.Size;
|
||||
MaximumSize = TerrainProperties.MaximumSize;
|
||||
TerrainProperties.MaximumSize = TerrainProperties.Size;
|
||||
Size = TerrainProperties.Size;
|
||||
Items.Add(host);
|
||||
TerrainProperties.Disposed += (sender, e) =>
|
||||
{
|
||||
TerrainProperties = null;
|
||||
Dispose(true);
|
||||
};
|
||||
}
|
||||
|
||||
protected override void OnClosed(ToolStripDropDownClosedEventArgs e)
|
||||
{
|
||||
base.OnClosed(e);
|
||||
|
||||
TerrainProperties.Terrain = null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -0,0 +1,50 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
partial class TypeComboBox
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Controls
|
||||
{
|
||||
public partial class TypeComboBox : ComboBox
|
||||
{
|
||||
[Category("Behavior")]
|
||||
public Image MissingThumbnail { get; set; } = SystemIcons.Error.ToBitmap();
|
||||
|
||||
public IEnumerable<IBrowsableType> Types
|
||||
{
|
||||
get => Items.Cast<TypeItem<IBrowsableType>>().Select(t => t.Type);
|
||||
set
|
||||
{
|
||||
DataSource = value.Select(t => new TypeItem<IBrowsableType>(t.DisplayName, t)).ToArray();
|
||||
DropDownHeight = Math.Max(DropDownHeight, value.Max(t => (t.Thumbnail?.Height ?? MissingThumbnail.Height) * 3));
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
public IBrowsableType SelectedType => SelectedValue as IBrowsableType;
|
||||
|
||||
public TypeComboBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
DisplayMember = "Name";
|
||||
ValueMember = "Type";
|
||||
}
|
||||
|
||||
protected override void OnMeasureItem(MeasureItemEventArgs e)
|
||||
{
|
||||
base.OnMeasureItem(e);
|
||||
|
||||
var typeItem = Items[e.Index] as TypeItem<IBrowsableType>;
|
||||
if (typeItem?.Type != null)
|
||||
{
|
||||
e.ItemHeight = typeItem.Type.Thumbnail?.Height ?? MissingThumbnail.Height;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnDrawItem(DrawItemEventArgs e)
|
||||
{
|
||||
base.OnDrawItem(e);
|
||||
|
||||
e.DrawBackground();
|
||||
|
||||
if ((e.Index >= 0) && (e.Index < Items.Count))
|
||||
{
|
||||
var typeItem = Items[e.Index] as TypeItem<IBrowsableType>;
|
||||
if (typeItem?.Type != null)
|
||||
{
|
||||
StringFormat stringFormat = new StringFormat
|
||||
{
|
||||
LineAlignment = StringAlignment.Center
|
||||
};
|
||||
|
||||
var textColor = ((e.State & DrawItemState.Selected) == DrawItemState.Selected) ? SystemBrushes.HighlightText : SystemBrushes.WindowText;
|
||||
var textSize = e.Graphics.MeasureString(typeItem.Name, Font, e.Bounds.Width, stringFormat);
|
||||
e.Graphics.DrawString(typeItem.Name, Font, textColor, e.Bounds, stringFormat);
|
||||
|
||||
if ((e.State & DrawItemState.ComboBoxEdit) == DrawItemState.None)
|
||||
{
|
||||
var thumbnail = typeItem.Type.Thumbnail ?? MissingThumbnail;
|
||||
var thumbnailWidth = (int)Math.Min(e.Bounds.Width - textSize.Width, thumbnail.Width);
|
||||
var thumbnailSize = new Size(thumbnailWidth, thumbnailWidth * thumbnail.Height / thumbnail.Width);
|
||||
var thumbnailBounds = new Rectangle(new Point(e.Bounds.Right - thumbnailSize.Width, e.Bounds.Top), thumbnailSize);
|
||||
e.Graphics.DrawImage(thumbnail, thumbnailBounds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
e.DrawFocusRectangle();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,158 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
partial class ErrorMessageBox
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.lblMessage = new System.Windows.Forms.Label();
|
||||
this.txtErrors = new System.Windows.Forms.TextBox();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.btnCopy = new System.Windows.Forms.Button();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 1;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.lblMessage, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.txtErrors, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 2);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 3;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(447, 285);
|
||||
this.tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// lblMessage
|
||||
//
|
||||
this.lblMessage.AutoSize = true;
|
||||
this.lblMessage.Location = new System.Drawing.Point(3, 0);
|
||||
this.lblMessage.Name = "lblMessage";
|
||||
this.lblMessage.Size = new System.Drawing.Size(191, 13);
|
||||
this.lblMessage.TabIndex = 1;
|
||||
this.lblMessage.Text = "The following errors were encountered:";
|
||||
//
|
||||
// txtErrors
|
||||
//
|
||||
this.txtErrors.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.txtErrors.Location = new System.Drawing.Point(3, 16);
|
||||
this.txtErrors.Multiline = true;
|
||||
this.txtErrors.Name = "txtErrors";
|
||||
this.txtErrors.ReadOnly = true;
|
||||
this.txtErrors.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.txtErrors.Size = new System.Drawing.Size(441, 231);
|
||||
this.txtErrors.TabIndex = 0;
|
||||
this.txtErrors.WordWrap = false;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoSize = true;
|
||||
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnOK);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnCopy);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 253);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(441, 29);
|
||||
this.flowLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnOK.Location = new System.Drawing.Point(363, 3);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnOK.TabIndex = 0;
|
||||
this.btnOK.Text = "&OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnCopy
|
||||
//
|
||||
this.btnCopy.Location = new System.Drawing.Point(246, 3);
|
||||
this.btnCopy.Name = "btnCopy";
|
||||
this.btnCopy.Size = new System.Drawing.Size(111, 23);
|
||||
this.btnCopy.TabIndex = 1;
|
||||
this.btnCopy.Text = "&Copy to Clipboard";
|
||||
this.btnCopy.UseVisualStyleBackColor = true;
|
||||
this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click);
|
||||
//
|
||||
// ErrorMessageBox
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnOK;
|
||||
this.ClientSize = new System.Drawing.Size(447, 285);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ErrorMessageBox";
|
||||
this.ShowInTaskbar = false;
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Error Report";
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.TextBox txtErrors;
|
||||
private System.Windows.Forms.Label lblMessage;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.Button btnCopy;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
public partial class ErrorMessageBox : Form
|
||||
{
|
||||
public string Message
|
||||
{
|
||||
set
|
||||
{
|
||||
lblMessage.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<string> Errors
|
||||
{
|
||||
set
|
||||
{
|
||||
txtErrors.Text = string.Join(Environment.NewLine, value);
|
||||
}
|
||||
}
|
||||
|
||||
public ErrorMessageBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnCopy_Click(object sender, EventArgs e)
|
||||
{
|
||||
Clipboard.SetText(txtErrors.Text);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -0,0 +1,153 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
partial class InviteMessageBox
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.checkBoxDontShowThisAgain = new System.Windows.Forms.CheckBox();
|
||||
this.pictureBoxIcon = new System.Windows.Forms.PictureBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.flowLayoutPanel2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxIcon)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.Controls.Add(this.flowLayoutPanel2);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnOK);
|
||||
this.flowLayoutPanel1.Controls.Add(this.checkBoxDontShowThisAgain);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(425, 97);
|
||||
this.flowLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// flowLayoutPanel2
|
||||
//
|
||||
this.flowLayoutPanel2.AutoSize = true;
|
||||
this.flowLayoutPanel2.Controls.Add(this.pictureBoxIcon);
|
||||
this.flowLayoutPanel2.Controls.Add(this.label1);
|
||||
this.flowLayoutPanel2.Location = new System.Drawing.Point(3, 3);
|
||||
this.flowLayoutPanel2.Name = "flowLayoutPanel2";
|
||||
this.flowLayoutPanel2.Size = new System.Drawing.Size(419, 38);
|
||||
this.flowLayoutPanel2.TabIndex = 0;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOK.Location = new System.Drawing.Point(175, 47);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnOK.TabIndex = 1;
|
||||
this.btnOK.Text = "&OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// checkBoxDontShowThisAgain
|
||||
//
|
||||
this.checkBoxDontShowThisAgain.AutoSize = true;
|
||||
this.flowLayoutPanel1.SetFlowBreak(this.checkBoxDontShowThisAgain, true);
|
||||
this.checkBoxDontShowThisAgain.Location = new System.Drawing.Point(3, 76);
|
||||
this.checkBoxDontShowThisAgain.Name = "checkBoxDontShowThisAgain";
|
||||
this.checkBoxDontShowThisAgain.Size = new System.Drawing.Size(127, 17);
|
||||
this.checkBoxDontShowThisAgain.TabIndex = 2;
|
||||
this.checkBoxDontShowThisAgain.Text = "Don\'t show this again";
|
||||
this.checkBoxDontShowThisAgain.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// pictureBoxIcon
|
||||
//
|
||||
this.pictureBoxIcon.Location = new System.Drawing.Point(3, 3);
|
||||
this.pictureBoxIcon.Name = "pictureBoxIcon";
|
||||
this.pictureBoxIcon.Size = new System.Drawing.Size(32, 32);
|
||||
this.pictureBoxIcon.TabIndex = 0;
|
||||
this.pictureBoxIcon.TabStop = false;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(41, 12);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(375, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "To join a game session or accept game invites, please first exit the Map Editor.";
|
||||
//
|
||||
// CheckMessageBox
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnOK;
|
||||
this.ClientSize = new System.Drawing.Size(425, 97);
|
||||
this.Controls.Add(this.flowLayoutPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "CheckMessageBox";
|
||||
this.ShowInTaskbar = false;
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Map Editor";
|
||||
this.Load += new System.EventHandler(this.InviteMessageBox_Load);
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.PerformLayout();
|
||||
this.flowLayoutPanel2.ResumeLayout(false);
|
||||
this.flowLayoutPanel2.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxIcon)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.CheckBox checkBoxDontShowThisAgain;
|
||||
private System.Windows.Forms.PictureBox pictureBoxIcon;
|
||||
private System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
public partial class InviteMessageBox : Form
|
||||
{
|
||||
public bool DontShowAgain => checkBoxDontShowThisAgain.Checked;
|
||||
|
||||
public InviteMessageBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InviteMessageBox_Load(object sender, EventArgs e)
|
||||
{
|
||||
using (var infoIcon = new Icon(SystemIcons.Information, pictureBoxIcon.Width, pictureBoxIcon.Height))
|
||||
{
|
||||
pictureBoxIcon.Image = infoIcon.ToBitmap();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -0,0 +1,166 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
partial class MapSettingsDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.settingsTreeView = new System.Windows.Forms.TreeView();
|
||||
this.settingsPanel = new System.Windows.Forms.Panel();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.settingsTreeView, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.settingsPanel, 1, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 2;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(784, 561);
|
||||
this.tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoSize = true;
|
||||
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.flowLayoutPanel1, 2);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnCancel);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnOK);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 524);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(778, 34);
|
||||
this.flowLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.AutoSize = true;
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(708, 2);
|
||||
this.btnCancel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(68, 30);
|
||||
this.btnCancel.TabIndex = 2;
|
||||
this.btnCancel.Text = "&Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.AutoSize = true;
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOK.Location = new System.Drawing.Point(654, 2);
|
||||
this.btnOK.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(50, 30);
|
||||
this.btnOK.TabIndex = 3;
|
||||
this.btnOK.Text = "&OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// settingsTreeView
|
||||
//
|
||||
this.settingsTreeView.CheckBoxes = true;
|
||||
this.settingsTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.settingsTreeView.DrawMode = System.Windows.Forms.TreeViewDrawMode.OwnerDrawText;
|
||||
this.settingsTreeView.HideSelection = false;
|
||||
this.settingsTreeView.Location = new System.Drawing.Point(3, 3);
|
||||
this.settingsTreeView.Name = "settingsTreeView";
|
||||
this.settingsTreeView.Size = new System.Drawing.Size(150, 515);
|
||||
this.settingsTreeView.TabIndex = 2;
|
||||
this.settingsTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.settingsTreeView_AfterCheck);
|
||||
this.settingsTreeView.DrawNode += new System.Windows.Forms.DrawTreeNodeEventHandler(this.settingsTreeView_DrawNode);
|
||||
this.settingsTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.settingsTreeView_AfterSelect);
|
||||
//
|
||||
// settingsPanel
|
||||
//
|
||||
this.settingsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.settingsPanel.Location = new System.Drawing.Point(166, 10);
|
||||
this.settingsPanel.Margin = new System.Windows.Forms.Padding(10, 10, 10, 10);
|
||||
this.settingsPanel.Name = "settingsPanel";
|
||||
this.settingsPanel.Size = new System.Drawing.Size(608, 501);
|
||||
this.settingsPanel.TabIndex = 3;
|
||||
//
|
||||
// MapSettingsDialog
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(784, 561);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "MapSettingsDialog";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Map Settings";
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.TreeView settingsTreeView;
|
||||
private System.Windows.Forms.Panel settingsPanel;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,157 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Controls;
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Model;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
public partial class MapSettingsDialog : Form
|
||||
{
|
||||
private const int TVIF_STATE = 0x8;
|
||||
private const int TVIS_STATEIMAGEMASK = 0xF000;
|
||||
private const int TV_FIRST = 0x1100;
|
||||
private const int TVM_SETITEM = TV_FIRST + 63;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
|
||||
|
||||
private struct TVITEM
|
||||
{
|
||||
public int mask;
|
||||
public IntPtr hItem;
|
||||
public int state;
|
||||
public int stateMask;
|
||||
[MarshalAs(UnmanagedType.LPTStr)]
|
||||
public String lpszText;
|
||||
public int cchTextMax;
|
||||
public int iImage;
|
||||
public int iSelectedImage;
|
||||
public int cChildren;
|
||||
public IntPtr lParam;
|
||||
}
|
||||
|
||||
private readonly IGamePlugin plugin;
|
||||
private readonly PropertyTracker<BasicSection> basicSettingsTracker;
|
||||
private readonly PropertyTracker<BriefingSection> briefingSettingsTracker;
|
||||
private readonly IDictionary<House, PropertyTracker<House>> houseSettingsTrackers;
|
||||
private readonly TreeNode playersNode;
|
||||
|
||||
public MapSettingsDialog(IGamePlugin plugin, PropertyTracker<BasicSection> basicSettingsTracker, PropertyTracker<BriefingSection> briefingSettingsTracker,
|
||||
IDictionary<House, PropertyTracker<House>> houseSettingsTrackers)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.plugin = plugin;
|
||||
this.basicSettingsTracker = basicSettingsTracker;
|
||||
this.briefingSettingsTracker = briefingSettingsTracker;
|
||||
this.houseSettingsTrackers = houseSettingsTrackers;
|
||||
|
||||
settingsTreeView.BeginUpdate();
|
||||
settingsTreeView.Nodes.Clear();
|
||||
settingsTreeView.Nodes.Add("BASIC", "Basic");
|
||||
settingsTreeView.Nodes.Add("BRIEFING", "Briefing");
|
||||
|
||||
playersNode = settingsTreeView.Nodes.Add("Players");
|
||||
foreach (var player in plugin.Map.Houses)
|
||||
{
|
||||
var playerNode = playersNode.Nodes.Add(player.Type.Name, player.Type.Name);
|
||||
playerNode.Checked = player.Enabled;
|
||||
}
|
||||
playersNode.Expand();
|
||||
|
||||
settingsTreeView.EndUpdate();
|
||||
settingsTreeView.SelectedNode = settingsTreeView.Nodes[0];
|
||||
}
|
||||
|
||||
private void settingsTreeView_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
settingsPanel.Controls.Clear();
|
||||
|
||||
switch (settingsTreeView.SelectedNode.Name)
|
||||
{
|
||||
case "BASIC":
|
||||
{
|
||||
settingsPanel.Controls.Add(new BasicSettings(plugin, basicSettingsTracker));
|
||||
}
|
||||
break;
|
||||
case "BRIEFING":
|
||||
{
|
||||
settingsPanel.Controls.Add(new BriefingSettings(plugin, briefingSettingsTracker));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
var player = plugin.Map.Houses.Where(h => h.Type.Name == settingsTreeView.SelectedNode.Name).FirstOrDefault();
|
||||
if (player != null)
|
||||
{
|
||||
settingsPanel.Controls.Add(new PlayerSettings(plugin, houseSettingsTrackers[player]));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void settingsTreeView_DrawNode(object sender, DrawTreeNodeEventArgs e)
|
||||
{
|
||||
if (!playersNode.Nodes.Contains(e.Node))
|
||||
{
|
||||
HideCheckBox(e.Node);
|
||||
e.DrawDefault = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Graphics.DrawString(e.Node.Text, e.Node.TreeView.Font, new SolidBrush(settingsTreeView.ForeColor), e.Node.Bounds.X, e.Node.Bounds.Y);
|
||||
}
|
||||
}
|
||||
|
||||
private void HideCheckBox(TreeNode node)
|
||||
{
|
||||
TVITEM tvi = new TVITEM
|
||||
{
|
||||
hItem = node.Handle,
|
||||
mask = TVIF_STATE,
|
||||
stateMask = TVIS_STATEIMAGEMASK,
|
||||
state = 0,
|
||||
lpszText = null,
|
||||
cchTextMax = 0,
|
||||
iImage = 0,
|
||||
iSelectedImage = 0,
|
||||
cChildren = 0,
|
||||
lParam = IntPtr.Zero
|
||||
};
|
||||
IntPtr lparam = Marshal.AllocHGlobal(Marshal.SizeOf(tvi));
|
||||
Marshal.StructureToPtr(tvi, lparam, false);
|
||||
SendMessage(node.TreeView.Handle, TVM_SETITEM, IntPtr.Zero, lparam);
|
||||
}
|
||||
|
||||
private void settingsTreeView_AfterCheck(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
var player = plugin.Map.Houses.Where(h => h.Type.Name == e.Node.Name).FirstOrDefault();
|
||||
if (player != null)
|
||||
{
|
||||
((dynamic)houseSettingsTrackers[player]).Enabled = e.Node.Checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -0,0 +1,301 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
partial class NewMapDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.radioTD = new System.Windows.Forms.RadioButton();
|
||||
this.radioRA = new System.Windows.Forms.RadioButton();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.flowLayoutPanel4 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.radioTheater1 = new System.Windows.Forms.RadioButton();
|
||||
this.radioTheater2 = new System.Windows.Forms.RadioButton();
|
||||
this.radioTheater3 = new System.Windows.Forms.RadioButton();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.flowLayoutPanel2.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.flowLayoutPanel3.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.flowLayoutPanel4.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 1;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel2, 0, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 2;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 13F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(356, 324);
|
||||
this.tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoSize = true;
|
||||
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnCancel);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnOK);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(2, 295);
|
||||
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(352, 27);
|
||||
this.flowLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.AutoSize = true;
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(300, 2);
|
||||
this.btnCancel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(50, 23);
|
||||
this.btnCancel.TabIndex = 1;
|
||||
this.btnCancel.Text = "&Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.AutoSize = true;
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOK.Location = new System.Drawing.Point(246, 2);
|
||||
this.btnOK.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(50, 23);
|
||||
this.btnOK.TabIndex = 0;
|
||||
this.btnOK.Text = "&OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// flowLayoutPanel2
|
||||
//
|
||||
this.flowLayoutPanel2.Controls.Add(this.groupBox1);
|
||||
this.flowLayoutPanel2.Controls.Add(this.groupBox2);
|
||||
this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel2.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
this.flowLayoutPanel2.Location = new System.Drawing.Point(2, 2);
|
||||
this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.flowLayoutPanel2.Name = "flowLayoutPanel2";
|
||||
this.flowLayoutPanel2.Size = new System.Drawing.Size(352, 289);
|
||||
this.flowLayoutPanel2.TabIndex = 1;
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.flowLayoutPanel3);
|
||||
this.groupBox1.Location = new System.Drawing.Point(2, 2);
|
||||
this.groupBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.groupBox1.Size = new System.Drawing.Size(339, 70);
|
||||
this.groupBox1.TabIndex = 2;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Game Type";
|
||||
//
|
||||
// flowLayoutPanel3
|
||||
//
|
||||
this.flowLayoutPanel3.AutoSize = true;
|
||||
this.flowLayoutPanel3.Controls.Add(this.radioTD);
|
||||
this.flowLayoutPanel3.Controls.Add(this.radioRA);
|
||||
this.flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel3.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
this.flowLayoutPanel3.Location = new System.Drawing.Point(2, 15);
|
||||
this.flowLayoutPanel3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.flowLayoutPanel3.Name = "flowLayoutPanel3";
|
||||
this.flowLayoutPanel3.Size = new System.Drawing.Size(335, 53);
|
||||
this.flowLayoutPanel3.TabIndex = 0;
|
||||
//
|
||||
// radioTD
|
||||
//
|
||||
this.radioTD.AutoSize = true;
|
||||
this.radioTD.Checked = true;
|
||||
this.radioTD.Location = new System.Drawing.Point(2, 2);
|
||||
this.radioTD.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.radioTD.Name = "radioTD";
|
||||
this.radioTD.Size = new System.Drawing.Size(94, 17);
|
||||
this.radioTD.TabIndex = 0;
|
||||
this.radioTD.TabStop = true;
|
||||
this.radioTD.Text = "Tiberian Dawn";
|
||||
this.radioTD.UseVisualStyleBackColor = true;
|
||||
this.radioTD.CheckedChanged += new System.EventHandler(this.radioGameType_CheckedChanged);
|
||||
//
|
||||
// radioRA
|
||||
//
|
||||
this.radioRA.AutoSize = true;
|
||||
this.radioRA.Location = new System.Drawing.Point(2, 23);
|
||||
this.radioRA.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.radioRA.Name = "radioRA";
|
||||
this.radioRA.Size = new System.Drawing.Size(69, 17);
|
||||
this.radioRA.TabIndex = 1;
|
||||
this.radioRA.Text = "Red Alert";
|
||||
this.radioRA.UseVisualStyleBackColor = true;
|
||||
this.radioRA.CheckedChanged += new System.EventHandler(this.radioGameType_CheckedChanged);
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox2.Controls.Add(this.flowLayoutPanel4);
|
||||
this.groupBox2.Location = new System.Drawing.Point(2, 76);
|
||||
this.groupBox2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.groupBox2.Size = new System.Drawing.Size(339, 89);
|
||||
this.groupBox2.TabIndex = 3;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Theater";
|
||||
//
|
||||
// flowLayoutPanel4
|
||||
//
|
||||
this.flowLayoutPanel4.AutoSize = true;
|
||||
this.flowLayoutPanel4.Controls.Add(this.radioTheater1);
|
||||
this.flowLayoutPanel4.Controls.Add(this.radioTheater2);
|
||||
this.flowLayoutPanel4.Controls.Add(this.radioTheater3);
|
||||
this.flowLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel4.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
this.flowLayoutPanel4.Location = new System.Drawing.Point(2, 15);
|
||||
this.flowLayoutPanel4.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.flowLayoutPanel4.Name = "flowLayoutPanel4";
|
||||
this.flowLayoutPanel4.Size = new System.Drawing.Size(335, 72);
|
||||
this.flowLayoutPanel4.TabIndex = 0;
|
||||
//
|
||||
// radioTheater1
|
||||
//
|
||||
this.radioTheater1.AutoSize = true;
|
||||
this.radioTheater1.Checked = true;
|
||||
this.radioTheater1.Location = new System.Drawing.Point(2, 2);
|
||||
this.radioTheater1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.radioTheater1.Name = "radioTheater1";
|
||||
this.radioTheater1.Size = new System.Drawing.Size(56, 17);
|
||||
this.radioTheater1.TabIndex = 0;
|
||||
this.radioTheater1.TabStop = true;
|
||||
this.radioTheater1.Text = "Desert";
|
||||
this.radioTheater1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// radioTheater2
|
||||
//
|
||||
this.radioTheater2.AutoSize = true;
|
||||
this.radioTheater2.Location = new System.Drawing.Point(2, 23);
|
||||
this.radioTheater2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.radioTheater2.Name = "radioTheater2";
|
||||
this.radioTheater2.Size = new System.Drawing.Size(76, 17);
|
||||
this.radioTheater2.TabIndex = 1;
|
||||
this.radioTheater2.Text = "Temperate";
|
||||
this.radioTheater2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// radioTheater3
|
||||
//
|
||||
this.radioTheater3.AutoSize = true;
|
||||
this.radioTheater3.Location = new System.Drawing.Point(2, 44);
|
||||
this.radioTheater3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.radioTheater3.Name = "radioTheater3";
|
||||
this.radioTheater3.Size = new System.Drawing.Size(56, 17);
|
||||
this.radioTheater3.TabIndex = 2;
|
||||
this.radioTheater3.TabStop = true;
|
||||
this.radioTheater3.Text = "Winter";
|
||||
this.radioTheater3.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// NewMapDialog
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(356, 324);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "NewMapDialog";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "New Map";
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.PerformLayout();
|
||||
this.flowLayoutPanel2.ResumeLayout(false);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.flowLayoutPanel3.ResumeLayout(false);
|
||||
this.flowLayoutPanel3.PerformLayout();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.flowLayoutPanel4.ResumeLayout(false);
|
||||
this.flowLayoutPanel4.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel3;
|
||||
private System.Windows.Forms.RadioButton radioTD;
|
||||
private System.Windows.Forms.RadioButton radioRA;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel4;
|
||||
private System.Windows.Forms.RadioButton radioTheater1;
|
||||
private System.Windows.Forms.RadioButton radioTheater2;
|
||||
private System.Windows.Forms.RadioButton radioTheater3;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
public partial class NewMapDialog : Form
|
||||
{
|
||||
private GameType gameType = GameType.TiberianDawn;
|
||||
public GameType GameType
|
||||
{
|
||||
get => gameType;
|
||||
set
|
||||
{
|
||||
if (gameType != value)
|
||||
{
|
||||
gameType = value;
|
||||
UpdateGameType();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string TheaterName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (radioTheater1.Checked) return radioTheater1.Text;
|
||||
if (radioTheater2.Checked) return radioTheater2.Text;
|
||||
if (radioTheater3.Checked) return radioTheater3.Text;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public NewMapDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void UpdateGameType()
|
||||
{
|
||||
switch(GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
{
|
||||
radioTheater1.Text = "Desert";
|
||||
radioTheater2.Text = "Temperate";
|
||||
radioTheater3.Text = "Winter";
|
||||
} break;
|
||||
case GameType.RedAlert:
|
||||
{
|
||||
radioTheater1.Text = "Temperate";
|
||||
radioTheater2.Text = "Snow";
|
||||
radioTheater3.Text = "Interior";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void radioGameType_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (radioTD.Checked)
|
||||
{
|
||||
GameType = GameType.TiberianDawn;
|
||||
}
|
||||
else if (radioRA.Checked)
|
||||
{
|
||||
GameType = GameType.RedAlert;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -0,0 +1,386 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
partial class SteamDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SteamDialog));
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.descriptionTxt = new System.Windows.Forms.TextBox();
|
||||
this.titleTxt = new System.Windows.Forms.TextBox();
|
||||
this.visibilityComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.previewTxt = new System.Windows.Forms.TextBox();
|
||||
this.previewBtn = new System.Windows.Forms.Button();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
this.btnGoToSteam = new System.Windows.Forms.Button();
|
||||
this.publicMapContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.publishAsNewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.statusLbl = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.btnPublishMap = new MobiusEditor.Controls.MenuButton();
|
||||
this.imageTooltip = new MobiusEditor.Controls.ImageTooltip();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.tableLayoutPanel2.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.publicMapContextMenuStrip.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 1;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.panel2, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label5, 0, 2);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 3;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(500, 385);
|
||||
this.tableLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// tableLayoutPanel2
|
||||
//
|
||||
this.tableLayoutPanel2.ColumnCount = 2;
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel2.Controls.Add(this.label1, 0, 0);
|
||||
this.tableLayoutPanel2.Controls.Add(this.label2, 0, 1);
|
||||
this.tableLayoutPanel2.Controls.Add(this.label3, 0, 2);
|
||||
this.tableLayoutPanel2.Controls.Add(this.label4, 0, 3);
|
||||
this.tableLayoutPanel2.Controls.Add(this.descriptionTxt, 0, 4);
|
||||
this.tableLayoutPanel2.Controls.Add(this.titleTxt, 1, 0);
|
||||
this.tableLayoutPanel2.Controls.Add(this.visibilityComboBox, 1, 1);
|
||||
this.tableLayoutPanel2.Controls.Add(this.panel1, 1, 2);
|
||||
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel2.Location = new System.Drawing.Point(2, 2);
|
||||
this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
|
||||
this.tableLayoutPanel2.RowCount = 5;
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 13F));
|
||||
this.tableLayoutPanel2.Size = new System.Drawing.Size(496, 233);
|
||||
this.tableLayoutPanel2.TabIndex = 2;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label1.Location = new System.Drawing.Point(2, 0);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(69, 24);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Title";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label2.Location = new System.Drawing.Point(2, 24);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(69, 25);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "Visibility";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label3.Location = new System.Drawing.Point(2, 49);
|
||||
this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(69, 27);
|
||||
this.label3.TabIndex = 2;
|
||||
this.label3.Text = "Preview";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label4.Location = new System.Drawing.Point(2, 76);
|
||||
this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(69, 13);
|
||||
this.label4.TabIndex = 3;
|
||||
this.label4.Text = "Description";
|
||||
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// descriptionTxt
|
||||
//
|
||||
this.tableLayoutPanel2.SetColumnSpan(this.descriptionTxt, 2);
|
||||
this.descriptionTxt.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.descriptionTxt.Location = new System.Drawing.Point(2, 91);
|
||||
this.descriptionTxt.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.descriptionTxt.Multiline = true;
|
||||
this.descriptionTxt.Name = "descriptionTxt";
|
||||
this.descriptionTxt.Size = new System.Drawing.Size(492, 202);
|
||||
this.descriptionTxt.TabIndex = 4;
|
||||
this.descriptionTxt.TextChanged += new System.EventHandler(this.descriptionTxt_TextChanged);
|
||||
//
|
||||
// titleTxt
|
||||
//
|
||||
this.titleTxt.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.titleTxt.Location = new System.Drawing.Point(75, 2);
|
||||
this.titleTxt.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.titleTxt.Name = "titleTxt";
|
||||
this.titleTxt.Size = new System.Drawing.Size(419, 20);
|
||||
this.titleTxt.TabIndex = 5;
|
||||
//
|
||||
// visibilityComboBox
|
||||
//
|
||||
this.visibilityComboBox.DisplayMember = "Name";
|
||||
this.visibilityComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.visibilityComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.visibilityComboBox.FormattingEnabled = true;
|
||||
this.visibilityComboBox.Location = new System.Drawing.Point(75, 26);
|
||||
this.visibilityComboBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.visibilityComboBox.Name = "visibilityComboBox";
|
||||
this.visibilityComboBox.Size = new System.Drawing.Size(419, 21);
|
||||
this.visibilityComboBox.TabIndex = 6;
|
||||
this.visibilityComboBox.ValueMember = "Value";
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.previewTxt);
|
||||
this.panel1.Controls.Add(this.previewBtn);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel1.Location = new System.Drawing.Point(75, 51);
|
||||
this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(419, 23);
|
||||
this.panel1.TabIndex = 7;
|
||||
//
|
||||
// previewTxt
|
||||
//
|
||||
this.previewTxt.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.previewTxt.Location = new System.Drawing.Point(2, 2);
|
||||
this.previewTxt.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.previewTxt.Name = "previewTxt";
|
||||
this.previewTxt.Size = new System.Drawing.Size(392, 20);
|
||||
this.previewTxt.TabIndex = 2;
|
||||
this.previewTxt.TextChanged += new System.EventHandler(this.previewTxt_TextChanged);
|
||||
//
|
||||
// previewBtn
|
||||
//
|
||||
this.previewBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.previewBtn.AutoSize = true;
|
||||
this.previewBtn.Location = new System.Drawing.Point(392, 2);
|
||||
this.previewBtn.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.previewBtn.Name = "previewBtn";
|
||||
this.previewBtn.Size = new System.Drawing.Size(26, 23);
|
||||
this.previewBtn.TabIndex = 3;
|
||||
this.previewBtn.Text = "...";
|
||||
this.previewBtn.UseVisualStyleBackColor = true;
|
||||
this.previewBtn.Click += new System.EventHandler(this.previewBtn_Click);
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Controls.Add(this.btnClose);
|
||||
this.panel2.Controls.Add(this.btnGoToSteam);
|
||||
this.panel2.Controls.Add(this.btnPublishMap);
|
||||
this.panel2.Controls.Add(this.statusLbl);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel2.Location = new System.Drawing.Point(2, 239);
|
||||
this.panel2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(496, 34);
|
||||
this.panel2.TabIndex = 3;
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnClose.AutoSize = true;
|
||||
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnClose.Location = new System.Drawing.Point(426, 2);
|
||||
this.btnClose.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(68, 30);
|
||||
this.btnClose.TabIndex = 6;
|
||||
this.btnClose.Text = "&Close";
|
||||
this.btnClose.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnGoToSteam
|
||||
//
|
||||
this.btnGoToSteam.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnGoToSteam.AutoSize = true;
|
||||
this.btnGoToSteam.Location = new System.Drawing.Point(346, 2);
|
||||
this.btnGoToSteam.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnGoToSteam.Name = "btnGoToSteam";
|
||||
this.btnGoToSteam.Size = new System.Drawing.Size(76, 30);
|
||||
this.btnGoToSteam.TabIndex = 7;
|
||||
this.btnGoToSteam.Text = "Go to &Steam";
|
||||
this.btnGoToSteam.UseVisualStyleBackColor = true;
|
||||
this.btnGoToSteam.Click += new System.EventHandler(this.btnGoToSteam_Click);
|
||||
//
|
||||
// publicMapContextMenuStrip
|
||||
//
|
||||
this.publicMapContextMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24);
|
||||
this.publicMapContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.publishAsNewToolStripMenuItem});
|
||||
this.publicMapContextMenuStrip.Name = "publicMapContextMenuStrip";
|
||||
this.publicMapContextMenuStrip.Size = new System.Drawing.Size(157, 26);
|
||||
//
|
||||
// publishAsNewToolStripMenuItem
|
||||
//
|
||||
this.publishAsNewToolStripMenuItem.Name = "publishAsNewToolStripMenuItem";
|
||||
this.publishAsNewToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
|
||||
this.publishAsNewToolStripMenuItem.Text = "Publish As New";
|
||||
this.publishAsNewToolStripMenuItem.Click += new System.EventHandler(this.publishAsNewToolStripMenuItem_Click);
|
||||
//
|
||||
// statusLbl
|
||||
//
|
||||
this.statusLbl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.statusLbl.Location = new System.Drawing.Point(7, 1);
|
||||
this.statusLbl.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.statusLbl.Name = "statusLbl";
|
||||
this.statusLbl.Size = new System.Drawing.Size(264, 31);
|
||||
this.statusLbl.TabIndex = 9;
|
||||
this.statusLbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label5.Location = new System.Drawing.Point(3, 275);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(494, 110);
|
||||
this.label5.TabIndex = 4;
|
||||
this.label5.Text = resources.GetString("label5.Text");
|
||||
//
|
||||
// btnPublishMap
|
||||
//
|
||||
this.btnPublishMap.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnPublishMap.AutoSize = true;
|
||||
this.btnPublishMap.Location = new System.Drawing.Point(234, 2);
|
||||
this.btnPublishMap.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnPublishMap.Menu = this.publicMapContextMenuStrip;
|
||||
this.btnPublishMap.Name = "btnPublishMap";
|
||||
this.btnPublishMap.Size = new System.Drawing.Size(111, 30);
|
||||
this.btnPublishMap.TabIndex = 8;
|
||||
this.btnPublishMap.Text = "&Publish Map";
|
||||
this.btnPublishMap.UseVisualStyleBackColor = true;
|
||||
this.btnPublishMap.Click += new System.EventHandler(this.btnPublishMap_Click);
|
||||
//
|
||||
// imageTooltip
|
||||
//
|
||||
this.imageTooltip.MaxSize = new System.Drawing.Size(0, 0);
|
||||
this.imageTooltip.OwnerDraw = true;
|
||||
this.imageTooltip.ShowAlways = true;
|
||||
//
|
||||
// SteamDialog
|
||||
//
|
||||
this.AcceptButton = this.btnPublishMap;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.CancelButton = this.btnClose;
|
||||
this.ClientSize = new System.Drawing.Size(500, 385);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.MinimumSize = new System.Drawing.Size(516, 357);
|
||||
this.Name = "SteamDialog";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Steam Workshop: Publish Custom Map";
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel2.ResumeLayout(false);
|
||||
this.tableLayoutPanel2.PerformLayout();
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.panel2.PerformLayout();
|
||||
this.publicMapContextMenuStrip.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.TextBox descriptionTxt;
|
||||
private System.Windows.Forms.TextBox titleTxt;
|
||||
private System.Windows.Forms.ComboBox visibilityComboBox;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.TextBox previewTxt;
|
||||
private System.Windows.Forms.Button previewBtn;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.Button btnClose;
|
||||
private System.Windows.Forms.Button btnGoToSteam;
|
||||
private MobiusEditor.Controls.MenuButton btnPublishMap;
|
||||
private System.Windows.Forms.Label statusLbl;
|
||||
private System.Windows.Forms.ContextMenuStrip publicMapContextMenuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem publishAsNewToolStripMenuItem;
|
||||
private Controls.ImageTooltip imageTooltip;
|
||||
private System.Windows.Forms.Label label5;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,253 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Controls;
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Utility;
|
||||
using Steamworks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
public partial class SteamDialog : Form
|
||||
{
|
||||
private static readonly string PreviewDirectory = Path.Combine(Path.GetTempPath(), "CnCRCMapEditor");
|
||||
|
||||
private readonly IGamePlugin plugin;
|
||||
private readonly Timer statusUpdateTimer = new Timer();
|
||||
|
||||
public SteamDialog(IGamePlugin plugin)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
visibilityComboBox.DataSource = new []
|
||||
{
|
||||
new { Name = "Public", Value = ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic },
|
||||
new { Name = "Friends Only", Value = ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityFriendsOnly },
|
||||
new { Name = "Private", Value = ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPrivate }
|
||||
};
|
||||
|
||||
statusUpdateTimer.Interval = 500;
|
||||
statusUpdateTimer.Tick += StatusUpdateTimer_Tick;
|
||||
|
||||
Disposed += (o, e) => { (previewTxt.Tag as Image)?.Dispose(); };
|
||||
}
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
|
||||
titleTxt.Text = plugin.Map.SteamSection.Title;
|
||||
descriptionTxt.Text = plugin.Map.SteamSection.Description;
|
||||
previewTxt.Text = plugin.Map.SteamSection.PreviewFile;
|
||||
visibilityComboBox.SelectedValue = plugin.Map.SteamSection.Visibility;
|
||||
|
||||
btnPublishMap.SplitWidth = (plugin.Map.SteamSection.PublishedFileId != PublishedFileId_t.Invalid.m_PublishedFileId) ? MenuButton.DefaultSplitWidth : 0;
|
||||
|
||||
Directory.CreateDirectory(PreviewDirectory);
|
||||
var previewPath = Path.Combine(PreviewDirectory, "Minimap.png");
|
||||
plugin.Map.GenerateWorkshopPreview().ToBitmap().Save(previewPath, ImageFormat.Png);
|
||||
|
||||
if (plugin.Map.BasicSection.SoloMission)
|
||||
{
|
||||
var soloBannerPath = Path.Combine(PreviewDirectory, "SoloBanner.png");
|
||||
Properties.Resources.UI_CustomMissionPreviewDefault.Save(soloBannerPath, ImageFormat.Png);
|
||||
previewTxt.Text = soloBannerPath;
|
||||
}
|
||||
else
|
||||
{
|
||||
previewTxt.Text = previewPath;
|
||||
}
|
||||
|
||||
imageTooltip.SetToolTip(previewTxt, "Preview.png");
|
||||
|
||||
statusUpdateTimer.Start();
|
||||
|
||||
UpdateControls();
|
||||
}
|
||||
|
||||
private void StatusUpdateTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
var status = SteamworksUGC.CurrentOperation?.Status;
|
||||
if (!string.IsNullOrEmpty(status))
|
||||
{
|
||||
statusLbl.Text = status;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnClosed(EventArgs e)
|
||||
{
|
||||
base.OnClosed(e);
|
||||
|
||||
statusUpdateTimer.Stop();
|
||||
statusUpdateTimer.Dispose();
|
||||
}
|
||||
|
||||
protected virtual void OnPublishSuccess()
|
||||
{
|
||||
statusLbl.Text = "Done.";
|
||||
EnableControls(true);
|
||||
}
|
||||
|
||||
protected virtual void OnOperationFailed(string status)
|
||||
{
|
||||
statusLbl.Text = status;
|
||||
EnableControls(true);
|
||||
}
|
||||
|
||||
private void EnableControls(bool enable)
|
||||
{
|
||||
titleTxt.Enabled = enable;
|
||||
visibilityComboBox.Enabled = enable;
|
||||
previewTxt.Enabled = enable;
|
||||
previewBtn.Enabled = enable;
|
||||
descriptionTxt.Enabled = enable;
|
||||
btnPublishMap.Enabled = enable;
|
||||
btnClose.Enabled = enable;
|
||||
}
|
||||
|
||||
private void btnGoToSteam_Click(object sender, EventArgs e)
|
||||
{
|
||||
var workshopUrl = SteamworksUGC.WorkshopURL;
|
||||
if (!string.IsNullOrEmpty(workshopUrl))
|
||||
{
|
||||
Process.Start(workshopUrl);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnPublishMap_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(plugin.Map.BasicSection.Name))
|
||||
{
|
||||
plugin.Map.BasicSection.Name = titleTxt.Text;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(plugin.Map.BasicSection.Author))
|
||||
{
|
||||
plugin.Map.BasicSection.Author = SteamFriends.GetPersonaName();
|
||||
}
|
||||
|
||||
plugin.Map.SteamSection.PreviewFile = previewTxt.Text;
|
||||
plugin.Map.SteamSection.Title = titleTxt.Text;
|
||||
plugin.Map.SteamSection.Description = descriptionTxt.Text;
|
||||
plugin.Map.SteamSection.Visibility = (ERemoteStoragePublishedFileVisibility)visibilityComboBox.SelectedValue;
|
||||
|
||||
var tempPath = Path.Combine(Path.GetTempPath(), "CnCRCMapEditorPublishUGC");
|
||||
Directory.CreateDirectory(tempPath);
|
||||
foreach (var file in new DirectoryInfo(tempPath).EnumerateFiles()) file.Delete();
|
||||
|
||||
var pgmPath = Path.Combine(tempPath, "MAPDATA.PGM");
|
||||
plugin.Save(pgmPath, FileType.PGM);
|
||||
|
||||
var tags = new List<string>();
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
tags.Add("TD");
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
tags.Add("RA");
|
||||
break;
|
||||
}
|
||||
|
||||
if (plugin.Map.BasicSection.SoloMission)
|
||||
{
|
||||
tags.Add("SinglePlayer");
|
||||
}
|
||||
else
|
||||
{
|
||||
tags.Add("MultiPlayer");
|
||||
}
|
||||
|
||||
if (SteamworksUGC.PublishUGC(tempPath, plugin.Map.SteamSection, tags, OnPublishSuccess, OnOperationFailed))
|
||||
{
|
||||
statusLbl.Text = SteamworksUGC.CurrentOperation.Status;
|
||||
EnableControls(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void previewBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
var ofd = new OpenFileDialog
|
||||
{
|
||||
AutoUpgradeEnabled = false,
|
||||
RestoreDirectory = true,
|
||||
Filter = "Preview Files (*.png)|*.png",
|
||||
CheckFileExists = true,
|
||||
InitialDirectory = Path.GetDirectoryName(previewTxt.Text),
|
||||
FileName = Path.GetFileName(previewTxt.Text)
|
||||
};
|
||||
if (!string.IsNullOrEmpty(previewTxt.Text))
|
||||
{
|
||||
ofd.FileName = previewTxt.Text;
|
||||
}
|
||||
if (ofd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
previewTxt.Text = ofd.FileName;
|
||||
}
|
||||
}
|
||||
|
||||
private void publishAsNewToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
plugin.Map.SteamSection.PublishedFileId = PublishedFileId_t.Invalid.m_PublishedFileId;
|
||||
btnPublishMap.PerformClick();
|
||||
}
|
||||
|
||||
private void previewTxt_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
(previewTxt.Tag as Image)?.Dispose();
|
||||
|
||||
Bitmap preview = null;
|
||||
using (Bitmap b = new Bitmap(previewTxt.Text))
|
||||
{
|
||||
preview = new Bitmap(b.Width, b.Height, b.PixelFormat);
|
||||
using (Graphics g = Graphics.FromImage(preview))
|
||||
{
|
||||
g.DrawImage(b, Point.Empty);
|
||||
g.Flush();
|
||||
}
|
||||
}
|
||||
|
||||
previewTxt.Tag = preview;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
previewTxt.Tag = null;
|
||||
}
|
||||
|
||||
UpdateControls();
|
||||
}
|
||||
|
||||
private void descriptionTxt_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateControls();
|
||||
}
|
||||
|
||||
private void UpdateControls()
|
||||
{
|
||||
btnPublishMap.Enabled = (previewTxt.Tag != null) && !string.IsNullOrEmpty(descriptionTxt.Text);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,131 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="publicMapContextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="label5.Text" xml:space="preserve">
|
||||
<value>Respect the rights of others. Provide only content (1) that is not defamatory, obscene, offensive or indecent, (2) that is not confidential or proprietary and (3) that does not violate or infringe any third-party rights. By providing content, you grant EA all licenses needed to enable EA’s use of the content for any purpose. EA’s User Agreement applies.
|
||||
|
||||
EA does not pre-screen, endorse or specifically support any C&&C mod. Please use mods with caution and understand there may be a risk. EA reserves the right to address any inappropriate use of our C&&C content.</value>
|
||||
</data>
|
||||
<metadata name="imageTooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>314, 17</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -0,0 +1,713 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
partial class TeamTypesDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.settingsPanel = new System.Windows.Forms.Panel();
|
||||
this.teamTypeTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.houseComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.roundaboutCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.learningCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.suicideCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.autocreateCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.mercernaryCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.reinforcableCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.prebuiltCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.initNumNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.maxAllowedNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.fearNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.waypointLabel = new System.Windows.Forms.Label();
|
||||
this.triggerLabel = new System.Windows.Forms.Label();
|
||||
this.waypointComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.triggerComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.recruitPriorityNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.teamsDataGridView = new System.Windows.Forms.DataGridView();
|
||||
this.teamsTypeColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
|
||||
this.teamsCountColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.missionsDataGridView = new System.Windows.Forms.DataGridView();
|
||||
this.missionsMissionColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
|
||||
this.missionsArgumentColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.teamTypesListView = new System.Windows.Forms.ListView();
|
||||
this.nameColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.teamTypesContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.addTeamTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.removeTeamTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.settingsPanel.SuspendLayout();
|
||||
this.teamTypeTableLayoutPanel.SuspendLayout();
|
||||
this.tableLayoutPanel2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.initNumNud)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.maxAllowedNud)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.fearNud)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.recruitPriorityNud)).BeginInit();
|
||||
this.tableLayoutPanel3.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.teamsDataGridView)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.missionsDataGridView)).BeginInit();
|
||||
this.teamTypesContextMenuStrip.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.settingsPanel, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.teamTypesListView, 0, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 2;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(1313, 640);
|
||||
this.tableLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoSize = true;
|
||||
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.flowLayoutPanel1, 2);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnCancel);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnOK);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(4, 583);
|
||||
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(1305, 52);
|
||||
this.flowLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.AutoSize = true;
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(1200, 3);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(102, 46);
|
||||
this.btnCancel.TabIndex = 2;
|
||||
this.btnCancel.Text = "&Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.AutoSize = true;
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOK.Location = new System.Drawing.Point(1119, 3);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(75, 46);
|
||||
this.btnOK.TabIndex = 3;
|
||||
this.btnOK.Text = "&OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// settingsPanel
|
||||
//
|
||||
this.settingsPanel.Controls.Add(this.teamTypeTableLayoutPanel);
|
||||
this.settingsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.settingsPanel.Location = new System.Drawing.Point(277, 15);
|
||||
this.settingsPanel.Margin = new System.Windows.Forms.Padding(15);
|
||||
this.settingsPanel.Name = "settingsPanel";
|
||||
this.settingsPanel.Size = new System.Drawing.Size(1021, 548);
|
||||
this.settingsPanel.TabIndex = 3;
|
||||
//
|
||||
// teamTypeTableLayoutPanel
|
||||
//
|
||||
this.teamTypeTableLayoutPanel.ColumnCount = 3;
|
||||
this.teamTypeTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.teamTypeTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.teamTypeTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.teamTypeTableLayoutPanel.Controls.Add(this.tableLayoutPanel2, 0, 0);
|
||||
this.teamTypeTableLayoutPanel.Controls.Add(this.tableLayoutPanel3, 2, 0);
|
||||
this.teamTypeTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.teamTypeTableLayoutPanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.teamTypeTableLayoutPanel.Name = "teamTypeTableLayoutPanel";
|
||||
this.teamTypeTableLayoutPanel.RowCount = 1;
|
||||
this.teamTypeTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.teamTypeTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 548F));
|
||||
this.teamTypeTableLayoutPanel.Size = new System.Drawing.Size(1021, 548);
|
||||
this.teamTypeTableLayoutPanel.TabIndex = 0;
|
||||
//
|
||||
// tableLayoutPanel2
|
||||
//
|
||||
this.tableLayoutPanel2.AutoSize = true;
|
||||
this.tableLayoutPanel2.ColumnCount = 2;
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel2.Controls.Add(this.label1, 0, 0);
|
||||
this.tableLayoutPanel2.Controls.Add(this.houseComboBox, 1, 0);
|
||||
this.tableLayoutPanel2.Controls.Add(this.roundaboutCheckBox, 1, 1);
|
||||
this.tableLayoutPanel2.Controls.Add(this.learningCheckBox, 1, 2);
|
||||
this.tableLayoutPanel2.Controls.Add(this.suicideCheckBox, 1, 3);
|
||||
this.tableLayoutPanel2.Controls.Add(this.autocreateCheckBox, 1, 4);
|
||||
this.tableLayoutPanel2.Controls.Add(this.mercernaryCheckBox, 1, 5);
|
||||
this.tableLayoutPanel2.Controls.Add(this.reinforcableCheckBox, 1, 6);
|
||||
this.tableLayoutPanel2.Controls.Add(this.prebuiltCheckBox, 1, 7);
|
||||
this.tableLayoutPanel2.Controls.Add(this.label2, 0, 9);
|
||||
this.tableLayoutPanel2.Controls.Add(this.label3, 0, 10);
|
||||
this.tableLayoutPanel2.Controls.Add(this.label4, 0, 11);
|
||||
this.tableLayoutPanel2.Controls.Add(this.initNumNud, 1, 9);
|
||||
this.tableLayoutPanel2.Controls.Add(this.maxAllowedNud, 1, 10);
|
||||
this.tableLayoutPanel2.Controls.Add(this.fearNud, 1, 11);
|
||||
this.tableLayoutPanel2.Controls.Add(this.waypointLabel, 0, 12);
|
||||
this.tableLayoutPanel2.Controls.Add(this.triggerLabel, 0, 13);
|
||||
this.tableLayoutPanel2.Controls.Add(this.waypointComboBox, 1, 12);
|
||||
this.tableLayoutPanel2.Controls.Add(this.triggerComboBox, 1, 13);
|
||||
this.tableLayoutPanel2.Controls.Add(this.label9, 0, 8);
|
||||
this.tableLayoutPanel2.Controls.Add(this.recruitPriorityNud, 1, 8);
|
||||
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 3);
|
||||
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
|
||||
this.tableLayoutPanel2.RowCount = 15;
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel2.Size = new System.Drawing.Size(307, 542);
|
||||
this.tableLayoutPanel2.TabIndex = 0;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label1.Location = new System.Drawing.Point(3, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(100, 34);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "House";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// houseComboBox
|
||||
//
|
||||
this.houseComboBox.DisplayMember = "Name";
|
||||
this.houseComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.houseComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.houseComboBox.FormattingEnabled = true;
|
||||
this.houseComboBox.Location = new System.Drawing.Point(109, 3);
|
||||
this.houseComboBox.Name = "houseComboBox";
|
||||
this.houseComboBox.Size = new System.Drawing.Size(195, 28);
|
||||
this.houseComboBox.TabIndex = 1;
|
||||
this.houseComboBox.ValueMember = "Type";
|
||||
//
|
||||
// roundaboutCheckBox
|
||||
//
|
||||
this.roundaboutCheckBox.AutoSize = true;
|
||||
this.roundaboutCheckBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.roundaboutCheckBox.Location = new System.Drawing.Point(109, 37);
|
||||
this.roundaboutCheckBox.Name = "roundaboutCheckBox";
|
||||
this.roundaboutCheckBox.Size = new System.Drawing.Size(195, 24);
|
||||
this.roundaboutCheckBox.TabIndex = 2;
|
||||
this.roundaboutCheckBox.Text = "Roundabout";
|
||||
this.roundaboutCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// learningCheckBox
|
||||
//
|
||||
this.learningCheckBox.AutoSize = true;
|
||||
this.learningCheckBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.learningCheckBox.Location = new System.Drawing.Point(109, 67);
|
||||
this.learningCheckBox.Name = "learningCheckBox";
|
||||
this.learningCheckBox.Size = new System.Drawing.Size(195, 24);
|
||||
this.learningCheckBox.TabIndex = 3;
|
||||
this.learningCheckBox.Text = "Learning";
|
||||
this.learningCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// suicideCheckBox
|
||||
//
|
||||
this.suicideCheckBox.AutoSize = true;
|
||||
this.suicideCheckBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.suicideCheckBox.Location = new System.Drawing.Point(109, 97);
|
||||
this.suicideCheckBox.Name = "suicideCheckBox";
|
||||
this.suicideCheckBox.Size = new System.Drawing.Size(195, 24);
|
||||
this.suicideCheckBox.TabIndex = 4;
|
||||
this.suicideCheckBox.Text = "Suicide";
|
||||
this.suicideCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// autocreateCheckBox
|
||||
//
|
||||
this.autocreateCheckBox.AutoSize = true;
|
||||
this.autocreateCheckBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.autocreateCheckBox.Location = new System.Drawing.Point(109, 127);
|
||||
this.autocreateCheckBox.Name = "autocreateCheckBox";
|
||||
this.autocreateCheckBox.Size = new System.Drawing.Size(195, 24);
|
||||
this.autocreateCheckBox.TabIndex = 5;
|
||||
this.autocreateCheckBox.Text = "Auto-create";
|
||||
this.autocreateCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// mercernaryCheckBox
|
||||
//
|
||||
this.mercernaryCheckBox.AutoSize = true;
|
||||
this.mercernaryCheckBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.mercernaryCheckBox.Location = new System.Drawing.Point(109, 157);
|
||||
this.mercernaryCheckBox.Name = "mercernaryCheckBox";
|
||||
this.mercernaryCheckBox.Size = new System.Drawing.Size(195, 24);
|
||||
this.mercernaryCheckBox.TabIndex = 6;
|
||||
this.mercernaryCheckBox.Text = "Mercernary";
|
||||
this.mercernaryCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// reinforcableCheckBox
|
||||
//
|
||||
this.reinforcableCheckBox.AutoSize = true;
|
||||
this.reinforcableCheckBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.reinforcableCheckBox.Location = new System.Drawing.Point(109, 187);
|
||||
this.reinforcableCheckBox.Name = "reinforcableCheckBox";
|
||||
this.reinforcableCheckBox.Size = new System.Drawing.Size(195, 24);
|
||||
this.reinforcableCheckBox.TabIndex = 7;
|
||||
this.reinforcableCheckBox.Text = "Reinforcable";
|
||||
this.reinforcableCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// prebuiltCheckBox
|
||||
//
|
||||
this.prebuiltCheckBox.AutoSize = true;
|
||||
this.prebuiltCheckBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.prebuiltCheckBox.Location = new System.Drawing.Point(109, 217);
|
||||
this.prebuiltCheckBox.Name = "prebuiltCheckBox";
|
||||
this.prebuiltCheckBox.Size = new System.Drawing.Size(195, 24);
|
||||
this.prebuiltCheckBox.TabIndex = 8;
|
||||
this.prebuiltCheckBox.Text = "Prebuilt";
|
||||
this.prebuiltCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label2.Location = new System.Drawing.Point(3, 276);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(100, 32);
|
||||
this.label2.TabIndex = 9;
|
||||
this.label2.Text = "Init Num";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label3.Location = new System.Drawing.Point(3, 308);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(100, 32);
|
||||
this.label3.TabIndex = 10;
|
||||
this.label3.Text = "Max Allowed";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label4.Location = new System.Drawing.Point(3, 340);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(100, 32);
|
||||
this.label4.TabIndex = 11;
|
||||
this.label4.Text = "Fear";
|
||||
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// initNumNud
|
||||
//
|
||||
this.initNumNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.initNumNud.Location = new System.Drawing.Point(109, 279);
|
||||
this.initNumNud.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.initNumNud.Name = "initNumNud";
|
||||
this.initNumNud.Size = new System.Drawing.Size(195, 26);
|
||||
this.initNumNud.TabIndex = 12;
|
||||
//
|
||||
// maxAllowedNud
|
||||
//
|
||||
this.maxAllowedNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.maxAllowedNud.Location = new System.Drawing.Point(109, 311);
|
||||
this.maxAllowedNud.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.maxAllowedNud.Name = "maxAllowedNud";
|
||||
this.maxAllowedNud.Size = new System.Drawing.Size(195, 26);
|
||||
this.maxAllowedNud.TabIndex = 13;
|
||||
//
|
||||
// fearNud
|
||||
//
|
||||
this.fearNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.fearNud.Location = new System.Drawing.Point(109, 343);
|
||||
this.fearNud.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.fearNud.Name = "fearNud";
|
||||
this.fearNud.Size = new System.Drawing.Size(195, 26);
|
||||
this.fearNud.TabIndex = 14;
|
||||
//
|
||||
// waypointLabel
|
||||
//
|
||||
this.waypointLabel.AutoSize = true;
|
||||
this.waypointLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.waypointLabel.Location = new System.Drawing.Point(3, 372);
|
||||
this.waypointLabel.Name = "waypointLabel";
|
||||
this.waypointLabel.Size = new System.Drawing.Size(100, 34);
|
||||
this.waypointLabel.TabIndex = 15;
|
||||
this.waypointLabel.Text = "Waypoint";
|
||||
this.waypointLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// triggerLabel
|
||||
//
|
||||
this.triggerLabel.AutoSize = true;
|
||||
this.triggerLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.triggerLabel.Location = new System.Drawing.Point(3, 406);
|
||||
this.triggerLabel.Name = "triggerLabel";
|
||||
this.triggerLabel.Size = new System.Drawing.Size(100, 34);
|
||||
this.triggerLabel.TabIndex = 16;
|
||||
this.triggerLabel.Text = "Trigger";
|
||||
this.triggerLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// waypointComboBox
|
||||
//
|
||||
this.waypointComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.waypointComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.waypointComboBox.FormattingEnabled = true;
|
||||
this.waypointComboBox.Location = new System.Drawing.Point(109, 375);
|
||||
this.waypointComboBox.Name = "waypointComboBox";
|
||||
this.waypointComboBox.Size = new System.Drawing.Size(195, 28);
|
||||
this.waypointComboBox.TabIndex = 17;
|
||||
//
|
||||
// triggerComboBox
|
||||
//
|
||||
this.triggerComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.triggerComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.triggerComboBox.FormattingEnabled = true;
|
||||
this.triggerComboBox.Location = new System.Drawing.Point(109, 409);
|
||||
this.triggerComboBox.Name = "triggerComboBox";
|
||||
this.triggerComboBox.Size = new System.Drawing.Size(195, 28);
|
||||
this.triggerComboBox.TabIndex = 18;
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label9.Location = new System.Drawing.Point(3, 244);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(100, 32);
|
||||
this.label9.TabIndex = 19;
|
||||
this.label9.Text = "Priority";
|
||||
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// recruitPriorityNud
|
||||
//
|
||||
this.recruitPriorityNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.recruitPriorityNud.Location = new System.Drawing.Point(109, 247);
|
||||
this.recruitPriorityNud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.recruitPriorityNud.Minimum = new decimal(new int[] {
|
||||
-2147483648,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
this.recruitPriorityNud.Name = "recruitPriorityNud";
|
||||
this.recruitPriorityNud.Size = new System.Drawing.Size(195, 26);
|
||||
this.recruitPriorityNud.TabIndex = 20;
|
||||
//
|
||||
// tableLayoutPanel3
|
||||
//
|
||||
this.tableLayoutPanel3.ColumnCount = 2;
|
||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel3.Controls.Add(this.label7, 0, 0);
|
||||
this.tableLayoutPanel3.Controls.Add(this.label8, 1, 0);
|
||||
this.tableLayoutPanel3.Controls.Add(this.teamsDataGridView, 0, 1);
|
||||
this.tableLayoutPanel3.Controls.Add(this.missionsDataGridView, 1, 1);
|
||||
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel3.Location = new System.Drawing.Point(316, 3);
|
||||
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
|
||||
this.tableLayoutPanel3.RowCount = 2;
|
||||
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel3.Size = new System.Drawing.Size(702, 542);
|
||||
this.tableLayoutPanel3.TabIndex = 1;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(3, 0);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(57, 20);
|
||||
this.label7.TabIndex = 0;
|
||||
this.label7.Text = "Teams";
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(354, 0);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(70, 20);
|
||||
this.label8.TabIndex = 1;
|
||||
this.label8.Text = "Missions";
|
||||
//
|
||||
// teamsDataGridView
|
||||
//
|
||||
this.teamsDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
|
||||
this.teamsDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
|
||||
this.teamsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.teamsDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.teamsTypeColumn,
|
||||
this.teamsCountColumn});
|
||||
this.teamsDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.teamsDataGridView.Location = new System.Drawing.Point(3, 23);
|
||||
this.teamsDataGridView.Name = "teamsDataGridView";
|
||||
this.teamsDataGridView.RowTemplate.Height = 28;
|
||||
this.teamsDataGridView.Size = new System.Drawing.Size(345, 516);
|
||||
this.teamsDataGridView.TabIndex = 2;
|
||||
this.teamsDataGridView.VirtualMode = true;
|
||||
this.teamsDataGridView.CancelRowEdit += new System.Windows.Forms.QuestionEventHandler(this.teamsDataGridView_CancelRowEdit);
|
||||
this.teamsDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.teamsDataGridView_CellValueNeeded);
|
||||
this.teamsDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.teamsDataGridView_CellValuePushed);
|
||||
this.teamsDataGridView.NewRowNeeded += new System.Windows.Forms.DataGridViewRowEventHandler(this.teamsDataGridView_NewRowNeeded);
|
||||
this.teamsDataGridView.RowDirtyStateNeeded += new System.Windows.Forms.QuestionEventHandler(this.teamsDataGridView_RowDirtyStateNeeded);
|
||||
this.teamsDataGridView.RowValidated += new System.Windows.Forms.DataGridViewCellEventHandler(this.teamsDataGridView_RowValidated);
|
||||
this.teamsDataGridView.UserAddedRow += new System.Windows.Forms.DataGridViewRowEventHandler(this.teamsDataGridView_UserAddedRow);
|
||||
this.teamsDataGridView.UserDeletedRow += new System.Windows.Forms.DataGridViewRowEventHandler(this.teamsDataGridView_UserDeletedRow);
|
||||
this.teamsDataGridView.UserDeletingRow += new System.Windows.Forms.DataGridViewRowCancelEventHandler(this.teamsDataGridView_UserDeletingRow);
|
||||
//
|
||||
// teamsTypeColumn
|
||||
//
|
||||
this.teamsTypeColumn.HeaderText = "Type";
|
||||
this.teamsTypeColumn.Name = "teamsTypeColumn";
|
||||
this.teamsTypeColumn.Width = 54;
|
||||
//
|
||||
// teamsCountColumn
|
||||
//
|
||||
this.teamsCountColumn.HeaderText = "Count";
|
||||
this.teamsCountColumn.Name = "teamsCountColumn";
|
||||
this.teamsCountColumn.Width = 88;
|
||||
//
|
||||
// missionsDataGridView
|
||||
//
|
||||
this.missionsDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
|
||||
this.missionsDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
|
||||
this.missionsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.missionsDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.missionsMissionColumn,
|
||||
this.missionsArgumentColumn});
|
||||
this.missionsDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.missionsDataGridView.Location = new System.Drawing.Point(354, 23);
|
||||
this.missionsDataGridView.Name = "missionsDataGridView";
|
||||
this.missionsDataGridView.RowTemplate.Height = 28;
|
||||
this.missionsDataGridView.Size = new System.Drawing.Size(345, 516);
|
||||
this.missionsDataGridView.TabIndex = 3;
|
||||
this.missionsDataGridView.VirtualMode = true;
|
||||
this.missionsDataGridView.CancelRowEdit += new System.Windows.Forms.QuestionEventHandler(this.missionsDataGridView_CancelRowEdit);
|
||||
this.missionsDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.missionsDataGridView_CellValueNeeded);
|
||||
this.missionsDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.missionsDataGridView_CellValuePushed);
|
||||
this.missionsDataGridView.NewRowNeeded += new System.Windows.Forms.DataGridViewRowEventHandler(this.missionsDataGridView_NewRowNeeded);
|
||||
this.missionsDataGridView.RowDirtyStateNeeded += new System.Windows.Forms.QuestionEventHandler(this.missionsDataGridView_RowDirtyStateNeeded);
|
||||
this.missionsDataGridView.RowValidated += new System.Windows.Forms.DataGridViewCellEventHandler(this.missionsDataGridView_RowValidated);
|
||||
this.missionsDataGridView.UserAddedRow += new System.Windows.Forms.DataGridViewRowEventHandler(this.missionsDataGridView_UserAddedRow);
|
||||
this.missionsDataGridView.UserDeletedRow += new System.Windows.Forms.DataGridViewRowEventHandler(this.missionsDataGridView_UserDeletedRow);
|
||||
this.missionsDataGridView.UserDeletingRow += new System.Windows.Forms.DataGridViewRowCancelEventHandler(this.missionsDataGridView_UserDeletingRow);
|
||||
//
|
||||
// missionsMissionColumn
|
||||
//
|
||||
this.missionsMissionColumn.HeaderText = "Mission";
|
||||
this.missionsMissionColumn.Name = "missionsMissionColumn";
|
||||
this.missionsMissionColumn.Width = 68;
|
||||
//
|
||||
// missionsArgumentColumn
|
||||
//
|
||||
this.missionsArgumentColumn.HeaderText = "Argument";
|
||||
this.missionsArgumentColumn.Name = "missionsArgumentColumn";
|
||||
this.missionsArgumentColumn.Width = 115;
|
||||
//
|
||||
// teamTypesListView
|
||||
//
|
||||
this.teamTypesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.nameColumnHeader});
|
||||
this.teamTypesListView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.teamTypesListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
|
||||
this.teamTypesListView.HideSelection = false;
|
||||
this.teamTypesListView.LabelEdit = true;
|
||||
this.teamTypesListView.Location = new System.Drawing.Point(3, 3);
|
||||
this.teamTypesListView.MultiSelect = false;
|
||||
this.teamTypesListView.Name = "teamTypesListView";
|
||||
this.teamTypesListView.ShowItemToolTips = true;
|
||||
this.teamTypesListView.Size = new System.Drawing.Size(256, 572);
|
||||
this.teamTypesListView.TabIndex = 4;
|
||||
this.teamTypesListView.UseCompatibleStateImageBehavior = false;
|
||||
this.teamTypesListView.View = System.Windows.Forms.View.Details;
|
||||
this.teamTypesListView.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.teamTypesListView_AfterLabelEdit);
|
||||
this.teamTypesListView.SelectedIndexChanged += new System.EventHandler(this.teamTypesListView_SelectedIndexChanged);
|
||||
this.teamTypesListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.teamTypesListView_KeyDown);
|
||||
this.teamTypesListView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.teamTypesListView_MouseDown);
|
||||
//
|
||||
// teamTypesContextMenuStrip
|
||||
//
|
||||
this.teamTypesContextMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24);
|
||||
this.teamTypesContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.addTeamTypeToolStripMenuItem,
|
||||
this.removeTeamTypeToolStripMenuItem});
|
||||
this.teamTypesContextMenuStrip.Name = "teamTypesContextMenuStrip";
|
||||
this.teamTypesContextMenuStrip.Size = new System.Drawing.Size(237, 64);
|
||||
//
|
||||
// addTeamTypeToolStripMenuItem
|
||||
//
|
||||
this.addTeamTypeToolStripMenuItem.Name = "addTeamTypeToolStripMenuItem";
|
||||
this.addTeamTypeToolStripMenuItem.Size = new System.Drawing.Size(236, 30);
|
||||
this.addTeamTypeToolStripMenuItem.Text = "&Add Team Type";
|
||||
this.addTeamTypeToolStripMenuItem.Click += new System.EventHandler(this.addTeamTypeToolStripMenuItem_Click);
|
||||
//
|
||||
// removeTeamTypeToolStripMenuItem
|
||||
//
|
||||
this.removeTeamTypeToolStripMenuItem.Name = "removeTeamTypeToolStripMenuItem";
|
||||
this.removeTeamTypeToolStripMenuItem.Size = new System.Drawing.Size(236, 30);
|
||||
this.removeTeamTypeToolStripMenuItem.Text = "&Remove Team Type";
|
||||
this.removeTeamTypeToolStripMenuItem.Click += new System.EventHandler(this.removeTeamTypeToolStripMenuItem_Click);
|
||||
//
|
||||
// TeamTypesDialog
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(1313, 640);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "TeamTypesDialog";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Team Types";
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.PerformLayout();
|
||||
this.settingsPanel.ResumeLayout(false);
|
||||
this.teamTypeTableLayoutPanel.ResumeLayout(false);
|
||||
this.teamTypeTableLayoutPanel.PerformLayout();
|
||||
this.tableLayoutPanel2.ResumeLayout(false);
|
||||
this.tableLayoutPanel2.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.initNumNud)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.maxAllowedNud)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.fearNud)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.recruitPriorityNud)).EndInit();
|
||||
this.tableLayoutPanel3.ResumeLayout(false);
|
||||
this.tableLayoutPanel3.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.teamsDataGridView)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.missionsDataGridView)).EndInit();
|
||||
this.teamTypesContextMenuStrip.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.Panel settingsPanel;
|
||||
private System.Windows.Forms.ListView teamTypesListView;
|
||||
private System.Windows.Forms.ColumnHeader nameColumnHeader;
|
||||
private System.Windows.Forms.ContextMenuStrip teamTypesContextMenuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem addTeamTypeToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem removeTeamTypeToolStripMenuItem;
|
||||
private System.Windows.Forms.TableLayoutPanel teamTypeTableLayoutPanel;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox houseComboBox;
|
||||
private System.Windows.Forms.CheckBox roundaboutCheckBox;
|
||||
private System.Windows.Forms.CheckBox learningCheckBox;
|
||||
private System.Windows.Forms.CheckBox suicideCheckBox;
|
||||
private System.Windows.Forms.CheckBox autocreateCheckBox;
|
||||
private System.Windows.Forms.CheckBox mercernaryCheckBox;
|
||||
private System.Windows.Forms.CheckBox reinforcableCheckBox;
|
||||
private System.Windows.Forms.CheckBox prebuiltCheckBox;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.NumericUpDown initNumNud;
|
||||
private System.Windows.Forms.NumericUpDown maxAllowedNud;
|
||||
private System.Windows.Forms.NumericUpDown fearNud;
|
||||
private System.Windows.Forms.Label waypointLabel;
|
||||
private System.Windows.Forms.Label triggerLabel;
|
||||
private System.Windows.Forms.ComboBox waypointComboBox;
|
||||
private System.Windows.Forms.ComboBox triggerComboBox;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.DataGridView teamsDataGridView;
|
||||
private System.Windows.Forms.DataGridView missionsDataGridView;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.NumericUpDown recruitPriorityNud;
|
||||
private System.Windows.Forms.DataGridViewComboBoxColumn teamsTypeColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn teamsCountColumn;
|
||||
private System.Windows.Forms.DataGridViewComboBoxColumn missionsMissionColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn missionsArgumentColumn;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,504 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Model;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
public partial class TeamTypesDialog : Form
|
||||
{
|
||||
private readonly IGamePlugin plugin;
|
||||
private readonly int maxTeams;
|
||||
private readonly IEnumerable<ITechnoType> technoTypes;
|
||||
|
||||
private readonly List<TeamType> teamTypes;
|
||||
public IEnumerable<TeamType> TeamTypes => teamTypes;
|
||||
|
||||
private ListViewItem SelectedItem => (teamTypesListView.SelectedItems.Count > 0) ? teamTypesListView.SelectedItems[0] : null;
|
||||
|
||||
private TeamType SelectedTeamType => SelectedItem?.Tag as TeamType;
|
||||
|
||||
private TeamTypeClass mockClass;
|
||||
private TeamTypeMission mockMission;
|
||||
private int classEditRow = -1;
|
||||
private int missionEditRow = -1;
|
||||
|
||||
public TeamTypesDialog(IGamePlugin plugin, int maxTeams)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
this.maxTeams = maxTeams;
|
||||
technoTypes = plugin.Map.InfantryTypes.Cast<ITechnoType>().Concat(plugin.Map.UnitTypes.Cast<ITechnoType>());
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
triggerLabel.Visible = triggerComboBox.Visible = false;
|
||||
waypointLabel.Visible = waypointComboBox.Visible = false;
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
learningCheckBox.Visible = false;
|
||||
mercernaryCheckBox.Visible = false;
|
||||
break;
|
||||
}
|
||||
|
||||
teamTypes = new List<TeamType>(plugin.Map.TeamTypes.Select(t => t.Clone()));
|
||||
|
||||
teamTypesListView.BeginUpdate();
|
||||
{
|
||||
foreach (var teamType in this.teamTypes)
|
||||
{
|
||||
var item = new ListViewItem(teamType.Name)
|
||||
{
|
||||
Tag = teamType
|
||||
};
|
||||
teamTypesListView.Items.Add(item).ToolTipText = teamType.Name;
|
||||
}
|
||||
}
|
||||
teamTypesListView.EndUpdate();
|
||||
|
||||
houseComboBox.DataSource = plugin.Map.Houses.Select(t => new TypeItem<HouseType>(t.Type.Name, t.Type)).ToArray();
|
||||
waypointComboBox.DataSource = "(none)".Yield().Concat(plugin.Map.Waypoints.Select(w => w.Name)).ToArray();
|
||||
triggerComboBox.DataSource = Trigger.None.Yield().Concat(plugin.Map.Triggers.Select(t => t.Name)).ToArray();
|
||||
|
||||
teamsTypeColumn.DisplayMember = "Name";
|
||||
teamsTypeColumn.ValueMember = "Type";
|
||||
teamsTypeColumn.DataSource = technoTypes.Select(t => new TypeItem<ITechnoType>(t.Name, t)).ToArray();
|
||||
|
||||
missionsMissionColumn.DataSource = plugin.Map.TeamMissionTypes;
|
||||
|
||||
teamTypeTableLayoutPanel.Visible = false;
|
||||
}
|
||||
|
||||
private void teamTypesListView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
houseComboBox.DataBindings.Clear();
|
||||
roundaboutCheckBox.DataBindings.Clear();
|
||||
learningCheckBox.DataBindings.Clear();
|
||||
suicideCheckBox.DataBindings.Clear();
|
||||
autocreateCheckBox.DataBindings.Clear();
|
||||
mercernaryCheckBox.DataBindings.Clear();
|
||||
reinforcableCheckBox.DataBindings.Clear();
|
||||
prebuiltCheckBox.DataBindings.Clear();
|
||||
recruitPriorityNud.DataBindings.Clear();
|
||||
initNumNud.DataBindings.Clear();
|
||||
maxAllowedNud.DataBindings.Clear();
|
||||
fearNud.DataBindings.Clear();
|
||||
waypointComboBox.DataBindings.Clear();
|
||||
triggerComboBox.DataBindings.Clear();
|
||||
|
||||
if (SelectedTeamType != null)
|
||||
{
|
||||
houseComboBox.DataBindings.Add("SelectedValue", SelectedTeamType, "House");
|
||||
roundaboutCheckBox.DataBindings.Add("Checked", SelectedTeamType, "IsRoundAbout");
|
||||
learningCheckBox.DataBindings.Add("Checked", SelectedTeamType, "IsLearning");
|
||||
suicideCheckBox.DataBindings.Add("Checked", SelectedTeamType, "IsSuicide");
|
||||
autocreateCheckBox.DataBindings.Add("Checked", SelectedTeamType, "IsAutocreate");
|
||||
mercernaryCheckBox.DataBindings.Add("Checked", SelectedTeamType, "IsMercenary");
|
||||
reinforcableCheckBox.DataBindings.Add("Checked", SelectedTeamType, "IsReinforcable");
|
||||
prebuiltCheckBox.DataBindings.Add("Checked", SelectedTeamType, "IsPrebuilt");
|
||||
recruitPriorityNud.DataBindings.Add("Value", SelectedTeamType, "RecruitPriority");
|
||||
initNumNud.DataBindings.Add("Value", SelectedTeamType, "InitNum");
|
||||
maxAllowedNud.DataBindings.Add("Value", SelectedTeamType, "MaxAllowed");
|
||||
fearNud.DataBindings.Add("Value", SelectedTeamType, "Fear");
|
||||
waypointComboBox.DataBindings.Add("SelectedIndex", SelectedTeamType, "Origin");
|
||||
triggerComboBox.DataBindings.Add("SelectedItem", SelectedTeamType, "Trigger");
|
||||
|
||||
mockClass = null;
|
||||
mockMission = null;
|
||||
classEditRow = -1;
|
||||
missionEditRow = -1;
|
||||
|
||||
teamsDataGridView.Rows.Clear();
|
||||
missionsDataGridView.Rows.Clear();
|
||||
|
||||
teamsDataGridView.RowCount = SelectedTeamType.Classes.Count + 1;
|
||||
missionsDataGridView.RowCount = SelectedTeamType.Missions.Count + 1;
|
||||
|
||||
updateDataGridViewAddRows(teamsDataGridView, Globals.MaxTeamClasses);
|
||||
updateDataGridViewAddRows(missionsDataGridView, Globals.MaxTeamMissions);
|
||||
|
||||
teamTypeTableLayoutPanel.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
teamTypeTableLayoutPanel.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void teamTypesListView_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
var hitTest = teamTypesListView.HitTest(e.Location);
|
||||
|
||||
bool canAdd = (hitTest.Item == null) && (teamTypesListView.Items.Count < maxTeams);
|
||||
bool canRemove = hitTest.Item != null;
|
||||
addTeamTypeToolStripMenuItem.Visible = canAdd;
|
||||
removeTeamTypeToolStripMenuItem.Visible = canRemove;
|
||||
|
||||
if (canAdd || canRemove)
|
||||
{
|
||||
teamTypesContextMenuStrip.Show(Cursor.Position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void teamTypesListView_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if ((e.KeyData == Keys.F2) && (teamTypesListView.SelectedItems.Count > 0))
|
||||
{
|
||||
teamTypesListView.SelectedItems[0].BeginEdit();
|
||||
}
|
||||
}
|
||||
|
||||
private void addTeamTypeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var nameChars = Enumerable.Range(97, 26).Concat(Enumerable.Range(48, 10));
|
||||
|
||||
string name = string.Empty;
|
||||
foreach (var nameChar in nameChars)
|
||||
{
|
||||
name = new string((char)nameChar, 4);
|
||||
if (!teamTypes.Where(t => t.Equals(name)).Any())
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var teamType = new TeamType { Name = name, House = plugin.Map.HouseTypes.First() };
|
||||
var item = new ListViewItem(teamType.Name)
|
||||
{
|
||||
Tag = teamType
|
||||
};
|
||||
teamTypes.Add(teamType);
|
||||
teamTypesListView.Items.Add(item).ToolTipText = teamType.Name;
|
||||
|
||||
item.Selected = true;
|
||||
item.BeginEdit();
|
||||
}
|
||||
|
||||
private void removeTeamTypeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (SelectedItem != null)
|
||||
{
|
||||
teamTypes.Remove(SelectedTeamType);
|
||||
teamTypesListView.Items.Remove(SelectedItem);
|
||||
}
|
||||
}
|
||||
|
||||
private void teamTypesListView_AfterLabelEdit(object sender, LabelEditEventArgs e)
|
||||
{
|
||||
int maxLength = int.MaxValue;
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
maxLength = 8;
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
maxLength = 23;
|
||||
break;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(e.Label))
|
||||
{
|
||||
e.CancelEdit = true;
|
||||
}
|
||||
else if (e.Label.Length > maxLength)
|
||||
{
|
||||
e.CancelEdit = true;
|
||||
MessageBox.Show(string.Format("Team name is longer than {0} characters.", maxLength), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
else if (teamTypes.Where(t => (t != SelectedTeamType) && t.Equals(e.Label)).Any())
|
||||
{
|
||||
e.CancelEdit = true;
|
||||
MessageBox.Show(string.Format("Team with name '{0]' already exists", e.Label), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedTeamType.Name = e.Label;
|
||||
teamTypesListView.Items[e.Item].ToolTipText = SelectedTeamType.Name;
|
||||
}
|
||||
}
|
||||
|
||||
private void teamsDataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
|
||||
{
|
||||
if (SelectedTeamType == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TeamTypeClass teamTypeClass = null;
|
||||
if (e.RowIndex == classEditRow)
|
||||
{
|
||||
teamTypeClass = mockClass;
|
||||
}
|
||||
else if (e.RowIndex < SelectedTeamType.Classes.Count)
|
||||
{
|
||||
teamTypeClass = SelectedTeamType.Classes[e.RowIndex];
|
||||
}
|
||||
|
||||
if (teamTypeClass == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (e.ColumnIndex)
|
||||
{
|
||||
case 0:
|
||||
e.Value = teamTypeClass.Type;
|
||||
break;
|
||||
case 1:
|
||||
e.Value = teamTypeClass.Count;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void teamsDataGridView_CellValuePushed(object sender, DataGridViewCellValueEventArgs e)
|
||||
{
|
||||
if (SelectedTeamType == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (mockClass == null)
|
||||
{
|
||||
mockClass = (e.RowIndex < SelectedTeamType.Classes.Count) ?
|
||||
new TeamTypeClass { Type = SelectedTeamType.Classes[e.RowIndex].Type, Count = SelectedTeamType.Classes[e.RowIndex].Count } :
|
||||
new TeamTypeClass { Type = technoTypes.First(), Count = 0 };
|
||||
}
|
||||
classEditRow = e.RowIndex;
|
||||
|
||||
switch (e.ColumnIndex)
|
||||
{
|
||||
case 0:
|
||||
mockClass.Type = e.Value as ITechnoType;
|
||||
break;
|
||||
case 1:
|
||||
mockClass.Count = int.TryParse(e.Value as string, out int value) ? (byte)Math.Max(0, Math.Min(255, value)) : (byte)0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void teamsDataGridView_NewRowNeeded(object sender, DataGridViewRowEventArgs e)
|
||||
{
|
||||
mockClass = new TeamTypeClass { Type = technoTypes.First(), Count = 0 };
|
||||
classEditRow = teamsDataGridView.RowCount - 1;
|
||||
}
|
||||
|
||||
private void teamsDataGridView_RowValidated(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if ((mockClass != null) && (e.RowIndex >= SelectedTeamType.Classes.Count) && ((teamsDataGridView.Rows.Count > 1) || (e.RowIndex < (teamsDataGridView.Rows.Count - 1))))
|
||||
{
|
||||
SelectedTeamType.Classes.Add(mockClass);
|
||||
mockClass = null;
|
||||
classEditRow = -1;
|
||||
}
|
||||
else if ((mockClass != null) && (e.RowIndex < SelectedTeamType.Classes.Count))
|
||||
{
|
||||
SelectedTeamType.Classes[e.RowIndex] = mockClass;
|
||||
mockClass = null;
|
||||
classEditRow = -1;
|
||||
}
|
||||
else if (teamsDataGridView.ContainsFocus)
|
||||
{
|
||||
mockClass = null;
|
||||
classEditRow = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private void teamsDataGridView_RowDirtyStateNeeded(object sender, QuestionEventArgs e)
|
||||
{
|
||||
e.Response = teamsDataGridView.IsCurrentCellDirty;
|
||||
}
|
||||
|
||||
private void teamsDataGridView_CancelRowEdit(object sender, QuestionEventArgs e)
|
||||
{
|
||||
if ((classEditRow == (teamsDataGridView.Rows.Count - 2)) && (classEditRow == SelectedTeamType.Classes.Count))
|
||||
{
|
||||
mockClass = new TeamTypeClass { Type = technoTypes.First(), Count = 0 };
|
||||
}
|
||||
else
|
||||
{
|
||||
mockClass = null;
|
||||
classEditRow = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private void teamsDataGridView_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
|
||||
{
|
||||
if (e.Row.Index < SelectedTeamType.Classes.Count)
|
||||
{
|
||||
SelectedTeamType.Classes.RemoveAt(e.Row.Index);
|
||||
}
|
||||
|
||||
if (e.Row.Index == classEditRow)
|
||||
{
|
||||
mockClass = null;
|
||||
classEditRow = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private void teamsDataGridView_UserAddedRow(object sender, DataGridViewRowEventArgs e)
|
||||
{
|
||||
updateDataGridViewAddRows(teamsDataGridView, Globals.MaxTeamClasses);
|
||||
}
|
||||
|
||||
private void teamsDataGridView_UserDeletedRow(object sender, DataGridViewRowEventArgs e)
|
||||
{
|
||||
updateDataGridViewAddRows(teamsDataGridView, Globals.MaxTeamClasses);
|
||||
}
|
||||
|
||||
private void missionsDataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
|
||||
{
|
||||
if (SelectedTeamType == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TeamTypeMission teamMissionType = null;
|
||||
if (e.RowIndex == missionEditRow)
|
||||
{
|
||||
teamMissionType = mockMission;
|
||||
}
|
||||
else if (e.RowIndex < SelectedTeamType.Missions.Count)
|
||||
{
|
||||
teamMissionType = SelectedTeamType.Missions[e.RowIndex];
|
||||
}
|
||||
|
||||
if (teamMissionType == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (e.ColumnIndex)
|
||||
{
|
||||
case 0:
|
||||
e.Value = teamMissionType.Mission;
|
||||
break;
|
||||
case 1:
|
||||
e.Value = teamMissionType.Argument;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void missionsDataGridView_CellValuePushed(object sender, DataGridViewCellValueEventArgs e)
|
||||
{
|
||||
if (SelectedTeamType == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (mockMission == null)
|
||||
{
|
||||
mockMission = (e.RowIndex < SelectedTeamType.Missions.Count) ?
|
||||
new TeamTypeMission { Mission = SelectedTeamType.Missions[e.RowIndex].Mission, Argument = SelectedTeamType.Missions[e.RowIndex].Argument } :
|
||||
new TeamTypeMission { Mission = plugin.Map.TeamMissionTypes.First(), Argument = 0 };
|
||||
}
|
||||
missionEditRow = e.RowIndex;
|
||||
|
||||
switch (e.ColumnIndex)
|
||||
{
|
||||
case 0:
|
||||
mockMission.Mission = e.Value as string;
|
||||
break;
|
||||
case 1:
|
||||
mockMission.Argument = int.TryParse(e.Value as string, out int value) ? value : 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void missionsDataGridView_NewRowNeeded(object sender, DataGridViewRowEventArgs e)
|
||||
{
|
||||
mockMission = new TeamTypeMission { Mission = plugin.Map.TeamMissionTypes.First(), Argument = 0 };
|
||||
missionEditRow = missionsDataGridView.RowCount - 1;
|
||||
}
|
||||
|
||||
private void missionsDataGridView_RowValidated(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if ((mockMission != null) && (e.RowIndex >= SelectedTeamType.Missions.Count) && ((missionsDataGridView.Rows.Count > 1) || (e.RowIndex < (missionsDataGridView.Rows.Count - 1))))
|
||||
{
|
||||
SelectedTeamType.Missions.Add(mockMission);
|
||||
mockMission = null;
|
||||
missionEditRow = -1;
|
||||
}
|
||||
else if ((mockMission != null) && (e.RowIndex < SelectedTeamType.Missions.Count))
|
||||
{
|
||||
SelectedTeamType.Missions[e.RowIndex] = mockMission;
|
||||
mockMission = null;
|
||||
missionEditRow = -1;
|
||||
}
|
||||
else if (missionsDataGridView.ContainsFocus)
|
||||
{
|
||||
mockMission = null;
|
||||
missionEditRow = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private void missionsDataGridView_RowDirtyStateNeeded(object sender, QuestionEventArgs e)
|
||||
{
|
||||
e.Response = missionsDataGridView.IsCurrentCellDirty;
|
||||
}
|
||||
|
||||
private void missionsDataGridView_CancelRowEdit(object sender, QuestionEventArgs e)
|
||||
{
|
||||
if ((missionEditRow == (missionsDataGridView.Rows.Count - 2)) && (missionEditRow == SelectedTeamType.Missions.Count))
|
||||
{
|
||||
mockMission = new TeamTypeMission { Mission = plugin.Map.TeamMissionTypes.First(), Argument = 0 };
|
||||
}
|
||||
else
|
||||
{
|
||||
mockMission = null;
|
||||
missionEditRow = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private void missionsDataGridView_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
|
||||
{
|
||||
if (e.Row.Index < SelectedTeamType.Missions.Count)
|
||||
{
|
||||
SelectedTeamType.Missions.RemoveAt(e.Row.Index);
|
||||
}
|
||||
|
||||
if (e.Row.Index == missionEditRow)
|
||||
{
|
||||
mockMission = null;
|
||||
missionEditRow = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private void missionsDataGridView_UserAddedRow(object sender, DataGridViewRowEventArgs e)
|
||||
{
|
||||
updateDataGridViewAddRows(missionsDataGridView, Globals.MaxTeamMissions);
|
||||
}
|
||||
|
||||
private void missionsDataGridView_UserDeletedRow(object sender, DataGridViewRowEventArgs e)
|
||||
{
|
||||
updateDataGridViewAddRows(missionsDataGridView, Globals.MaxTeamMissions);
|
||||
}
|
||||
|
||||
private void updateDataGridViewAddRows(DataGridView dataGridView, int maxItems)
|
||||
{
|
||||
dataGridView.AllowUserToAddRows = dataGridView.Rows.Count <= maxItems;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,135 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="teamsTypeColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="teamsCountColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="missionsMissionColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="missionsArgumentColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="teamTypesContextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -0,0 +1,687 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
partial class TriggersDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.settingsPanel = new System.Windows.Forms.Panel();
|
||||
this.triggersTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.houseComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.typeLabel = new System.Windows.Forms.Label();
|
||||
this.event1Label = new System.Windows.Forms.Label();
|
||||
this.event2Label = new System.Windows.Forms.Label();
|
||||
this.action1Label = new System.Windows.Forms.Label();
|
||||
this.action2Label = new System.Windows.Forms.Label();
|
||||
this.action1ComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.action2ComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.existenceLabel = new System.Windows.Forms.Label();
|
||||
this.existenceComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.typeComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.event1ComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.event2ComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.teamLabel = new System.Windows.Forms.Label();
|
||||
this.teamComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.event1Flp = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.event1Nud = new System.Windows.Forms.NumericUpDown();
|
||||
this.event1ValueComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.event2Flp = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.event2Nud = new System.Windows.Forms.NumericUpDown();
|
||||
this.event2ValueComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.action1Flp = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.action1Nud = new System.Windows.Forms.NumericUpDown();
|
||||
this.action1ValueComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.action2Flp = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.action2Nud = new System.Windows.Forms.NumericUpDown();
|
||||
this.action2ValueComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.triggersListView = new System.Windows.Forms.ListView();
|
||||
this.nameColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.triggersContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.addTriggerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.removeTriggerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.settingsPanel.SuspendLayout();
|
||||
this.triggersTableLayoutPanel.SuspendLayout();
|
||||
this.event1Flp.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.event1Nud)).BeginInit();
|
||||
this.event2Flp.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.event2Nud)).BeginInit();
|
||||
this.action1Flp.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.action1Nud)).BeginInit();
|
||||
this.action2Flp.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.action2Nud)).BeginInit();
|
||||
this.triggersContextMenuStrip.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.settingsPanel, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.triggersListView, 0, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 2;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(562, 499);
|
||||
this.tableLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoSize = true;
|
||||
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.flowLayoutPanel1, 2);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnCancel);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnOK);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 462);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(556, 34);
|
||||
this.flowLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.AutoSize = true;
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(486, 2);
|
||||
this.btnCancel.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(68, 30);
|
||||
this.btnCancel.TabIndex = 2;
|
||||
this.btnCancel.Text = "&Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.AutoSize = true;
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOK.Location = new System.Drawing.Point(432, 2);
|
||||
this.btnOK.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(50, 30);
|
||||
this.btnOK.TabIndex = 3;
|
||||
this.btnOK.Text = "&OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// settingsPanel
|
||||
//
|
||||
this.settingsPanel.Controls.Add(this.triggersTableLayoutPanel);
|
||||
this.settingsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.settingsPanel.Location = new System.Drawing.Point(149, 10);
|
||||
this.settingsPanel.Margin = new System.Windows.Forms.Padding(10);
|
||||
this.settingsPanel.Name = "settingsPanel";
|
||||
this.settingsPanel.Size = new System.Drawing.Size(403, 439);
|
||||
this.settingsPanel.TabIndex = 3;
|
||||
//
|
||||
// triggersTableLayoutPanel
|
||||
//
|
||||
this.triggersTableLayoutPanel.AutoSize = true;
|
||||
this.triggersTableLayoutPanel.ColumnCount = 4;
|
||||
this.triggersTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.triggersTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.triggersTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.triggersTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.label1, 0, 0);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.houseComboBox, 1, 0);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.typeLabel, 0, 9);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.event1Label, 0, 10);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.event2Label, 0, 11);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.action1Label, 0, 12);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.action2Label, 0, 13);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.action1ComboBox, 1, 12);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.action2ComboBox, 1, 13);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.existenceLabel, 0, 8);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.existenceComboBox, 1, 8);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.typeComboBox, 1, 9);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.event1ComboBox, 1, 10);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.event2ComboBox, 1, 11);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.teamLabel, 0, 14);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.teamComboBox, 1, 14);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.event1Flp, 2, 10);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.event2Flp, 2, 11);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.action1Flp, 2, 12);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.action2Flp, 2, 13);
|
||||
this.triggersTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.triggersTableLayoutPanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.triggersTableLayoutPanel.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.triggersTableLayoutPanel.Name = "triggersTableLayoutPanel";
|
||||
this.triggersTableLayoutPanel.RowCount = 17;
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.triggersTableLayoutPanel.Size = new System.Drawing.Size(403, 439);
|
||||
this.triggersTableLayoutPanel.TabIndex = 1;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label1.Location = new System.Drawing.Point(2, 0);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(67, 25);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "House";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// houseComboBox
|
||||
//
|
||||
this.houseComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.houseComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.houseComboBox.FormattingEnabled = true;
|
||||
this.houseComboBox.Location = new System.Drawing.Point(73, 2);
|
||||
this.houseComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.houseComboBox.Name = "houseComboBox";
|
||||
this.houseComboBox.Size = new System.Drawing.Size(141, 21);
|
||||
this.houseComboBox.TabIndex = 1;
|
||||
//
|
||||
// typeLabel
|
||||
//
|
||||
this.typeLabel.AutoSize = true;
|
||||
this.typeLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.typeLabel.Location = new System.Drawing.Point(2, 50);
|
||||
this.typeLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.typeLabel.Name = "typeLabel";
|
||||
this.typeLabel.Size = new System.Drawing.Size(67, 25);
|
||||
this.typeLabel.TabIndex = 9;
|
||||
this.typeLabel.Text = "Type";
|
||||
this.typeLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// event1Label
|
||||
//
|
||||
this.event1Label.AutoSize = true;
|
||||
this.event1Label.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.event1Label.Location = new System.Drawing.Point(2, 75);
|
||||
this.event1Label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.event1Label.Name = "event1Label";
|
||||
this.event1Label.Size = new System.Drawing.Size(67, 57);
|
||||
this.event1Label.TabIndex = 10;
|
||||
this.event1Label.Text = "Event 1";
|
||||
this.event1Label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// event2Label
|
||||
//
|
||||
this.event2Label.AutoSize = true;
|
||||
this.event2Label.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.event2Label.Location = new System.Drawing.Point(2, 132);
|
||||
this.event2Label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.event2Label.Name = "event2Label";
|
||||
this.event2Label.Size = new System.Drawing.Size(67, 57);
|
||||
this.event2Label.TabIndex = 11;
|
||||
this.event2Label.Text = "Event 2";
|
||||
this.event2Label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// action1Label
|
||||
//
|
||||
this.action1Label.AutoSize = true;
|
||||
this.action1Label.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.action1Label.Location = new System.Drawing.Point(2, 189);
|
||||
this.action1Label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.action1Label.Name = "action1Label";
|
||||
this.action1Label.Size = new System.Drawing.Size(67, 57);
|
||||
this.action1Label.TabIndex = 15;
|
||||
this.action1Label.Text = "Action 1";
|
||||
this.action1Label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// action2Label
|
||||
//
|
||||
this.action2Label.AutoSize = true;
|
||||
this.action2Label.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.action2Label.Location = new System.Drawing.Point(2, 246);
|
||||
this.action2Label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.action2Label.Name = "action2Label";
|
||||
this.action2Label.Size = new System.Drawing.Size(67, 57);
|
||||
this.action2Label.TabIndex = 16;
|
||||
this.action2Label.Text = "Action 2";
|
||||
this.action2Label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// action1ComboBox
|
||||
//
|
||||
this.action1ComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.action1ComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.action1ComboBox.FormattingEnabled = true;
|
||||
this.action1ComboBox.Location = new System.Drawing.Point(73, 191);
|
||||
this.action1ComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.action1ComboBox.Name = "action1ComboBox";
|
||||
this.action1ComboBox.Size = new System.Drawing.Size(141, 21);
|
||||
this.action1ComboBox.TabIndex = 17;
|
||||
this.action1ComboBox.SelectedIndexChanged += new System.EventHandler(this.trigger1ComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// action2ComboBox
|
||||
//
|
||||
this.action2ComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.action2ComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.action2ComboBox.FormattingEnabled = true;
|
||||
this.action2ComboBox.Location = new System.Drawing.Point(73, 248);
|
||||
this.action2ComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.action2ComboBox.Name = "action2ComboBox";
|
||||
this.action2ComboBox.Size = new System.Drawing.Size(141, 21);
|
||||
this.action2ComboBox.TabIndex = 18;
|
||||
this.action2ComboBox.SelectedIndexChanged += new System.EventHandler(this.trigger2ComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// existenceLabel
|
||||
//
|
||||
this.existenceLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.existenceLabel.Location = new System.Drawing.Point(2, 25);
|
||||
this.existenceLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.existenceLabel.Name = "existenceLabel";
|
||||
this.existenceLabel.Size = new System.Drawing.Size(67, 25);
|
||||
this.existenceLabel.TabIndex = 19;
|
||||
this.existenceLabel.Text = "Existence";
|
||||
this.existenceLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// existenceComboBox
|
||||
//
|
||||
this.existenceComboBox.DisplayMember = "Name";
|
||||
this.existenceComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.existenceComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.existenceComboBox.FormattingEnabled = true;
|
||||
this.existenceComboBox.Location = new System.Drawing.Point(73, 27);
|
||||
this.existenceComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.existenceComboBox.Name = "existenceComboBox";
|
||||
this.existenceComboBox.Size = new System.Drawing.Size(141, 21);
|
||||
this.existenceComboBox.TabIndex = 20;
|
||||
this.existenceComboBox.ValueMember = "Value";
|
||||
//
|
||||
// typeComboBox
|
||||
//
|
||||
this.typeComboBox.DisplayMember = "Name";
|
||||
this.typeComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.typeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.typeComboBox.FormattingEnabled = true;
|
||||
this.typeComboBox.Location = new System.Drawing.Point(73, 52);
|
||||
this.typeComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.typeComboBox.Name = "typeComboBox";
|
||||
this.typeComboBox.Size = new System.Drawing.Size(141, 21);
|
||||
this.typeComboBox.TabIndex = 21;
|
||||
this.typeComboBox.ValueMember = "Value";
|
||||
this.typeComboBox.SelectedValueChanged += new System.EventHandler(this.typeComboBox_SelectedValueChanged);
|
||||
//
|
||||
// event1ComboBox
|
||||
//
|
||||
this.event1ComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.event1ComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.event1ComboBox.FormattingEnabled = true;
|
||||
this.event1ComboBox.Location = new System.Drawing.Point(73, 77);
|
||||
this.event1ComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.event1ComboBox.Name = "event1ComboBox";
|
||||
this.event1ComboBox.Size = new System.Drawing.Size(141, 21);
|
||||
this.event1ComboBox.TabIndex = 22;
|
||||
this.event1ComboBox.SelectedIndexChanged += new System.EventHandler(this.trigger1ComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// event2ComboBox
|
||||
//
|
||||
this.event2ComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.event2ComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.event2ComboBox.FormattingEnabled = true;
|
||||
this.event2ComboBox.Location = new System.Drawing.Point(73, 134);
|
||||
this.event2ComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.event2ComboBox.Name = "event2ComboBox";
|
||||
this.event2ComboBox.Size = new System.Drawing.Size(141, 21);
|
||||
this.event2ComboBox.TabIndex = 23;
|
||||
this.event2ComboBox.SelectedIndexChanged += new System.EventHandler(this.trigger2ComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// teamLabel
|
||||
//
|
||||
this.teamLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.teamLabel.Location = new System.Drawing.Point(2, 303);
|
||||
this.teamLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.teamLabel.Name = "teamLabel";
|
||||
this.teamLabel.Size = new System.Drawing.Size(67, 25);
|
||||
this.teamLabel.TabIndex = 32;
|
||||
this.teamLabel.Text = "Team";
|
||||
this.teamLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// teamComboBox
|
||||
//
|
||||
this.teamComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.teamComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.teamComboBox.FormattingEnabled = true;
|
||||
this.teamComboBox.Location = new System.Drawing.Point(73, 305);
|
||||
this.teamComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.teamComboBox.Name = "teamComboBox";
|
||||
this.teamComboBox.Size = new System.Drawing.Size(141, 21);
|
||||
this.teamComboBox.TabIndex = 33;
|
||||
//
|
||||
// event1Flp
|
||||
//
|
||||
this.event1Flp.AutoSize = true;
|
||||
this.event1Flp.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.event1Flp.Controls.Add(this.event1Nud);
|
||||
this.event1Flp.Controls.Add(this.event1ValueComboBox);
|
||||
this.event1Flp.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.event1Flp.Location = new System.Drawing.Point(219, 78);
|
||||
this.event1Flp.Name = "event1Flp";
|
||||
this.event1Flp.Size = new System.Drawing.Size(172, 51);
|
||||
this.event1Flp.TabIndex = 36;
|
||||
//
|
||||
// event1Nud
|
||||
//
|
||||
this.event1Nud.Location = new System.Drawing.Point(2, 2);
|
||||
this.event1Nud.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.event1Nud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.event1Nud.Minimum = new decimal(new int[] {
|
||||
-2147483648,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
this.event1Nud.Name = "event1Nud";
|
||||
this.event1Nud.Size = new System.Drawing.Size(70, 20);
|
||||
this.event1Nud.TabIndex = 31;
|
||||
//
|
||||
// event1ValueComboBox
|
||||
//
|
||||
this.event1ValueComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.event1ValueComboBox.FormattingEnabled = true;
|
||||
this.event1ValueComboBox.Location = new System.Drawing.Point(3, 27);
|
||||
this.event1ValueComboBox.Name = "event1ValueComboBox";
|
||||
this.event1ValueComboBox.Size = new System.Drawing.Size(166, 21);
|
||||
this.event1ValueComboBox.TabIndex = 32;
|
||||
//
|
||||
// event2Flp
|
||||
//
|
||||
this.event2Flp.AutoSize = true;
|
||||
this.event2Flp.Controls.Add(this.event2Nud);
|
||||
this.event2Flp.Controls.Add(this.event2ValueComboBox);
|
||||
this.event2Flp.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.event2Flp.Location = new System.Drawing.Point(219, 135);
|
||||
this.event2Flp.Name = "event2Flp";
|
||||
this.event2Flp.Size = new System.Drawing.Size(172, 51);
|
||||
this.event2Flp.TabIndex = 37;
|
||||
//
|
||||
// event2Nud
|
||||
//
|
||||
this.event2Nud.Location = new System.Drawing.Point(2, 2);
|
||||
this.event2Nud.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.event2Nud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.event2Nud.Minimum = new decimal(new int[] {
|
||||
-2147483648,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
this.event2Nud.Name = "event2Nud";
|
||||
this.event2Nud.Size = new System.Drawing.Size(70, 20);
|
||||
this.event2Nud.TabIndex = 30;
|
||||
//
|
||||
// event2ValueComboBox
|
||||
//
|
||||
this.event2ValueComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.event2ValueComboBox.FormattingEnabled = true;
|
||||
this.event2ValueComboBox.Location = new System.Drawing.Point(3, 27);
|
||||
this.event2ValueComboBox.Name = "event2ValueComboBox";
|
||||
this.event2ValueComboBox.Size = new System.Drawing.Size(166, 21);
|
||||
this.event2ValueComboBox.TabIndex = 33;
|
||||
//
|
||||
// action1Flp
|
||||
//
|
||||
this.action1Flp.AutoSize = true;
|
||||
this.action1Flp.Controls.Add(this.action1Nud);
|
||||
this.action1Flp.Controls.Add(this.action1ValueComboBox);
|
||||
this.action1Flp.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.action1Flp.Location = new System.Drawing.Point(219, 192);
|
||||
this.action1Flp.Name = "action1Flp";
|
||||
this.action1Flp.Size = new System.Drawing.Size(172, 51);
|
||||
this.action1Flp.TabIndex = 38;
|
||||
//
|
||||
// action1Nud
|
||||
//
|
||||
this.action1Nud.Location = new System.Drawing.Point(2, 2);
|
||||
this.action1Nud.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.action1Nud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.action1Nud.Minimum = new decimal(new int[] {
|
||||
-2147483648,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
this.action1Nud.Name = "action1Nud";
|
||||
this.action1Nud.Size = new System.Drawing.Size(70, 20);
|
||||
this.action1Nud.TabIndex = 31;
|
||||
//
|
||||
// action1ValueComboBox
|
||||
//
|
||||
this.action1ValueComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.action1ValueComboBox.FormattingEnabled = true;
|
||||
this.action1ValueComboBox.Location = new System.Drawing.Point(3, 27);
|
||||
this.action1ValueComboBox.Name = "action1ValueComboBox";
|
||||
this.action1ValueComboBox.Size = new System.Drawing.Size(166, 21);
|
||||
this.action1ValueComboBox.TabIndex = 33;
|
||||
//
|
||||
// action2Flp
|
||||
//
|
||||
this.action2Flp.AutoSize = true;
|
||||
this.action2Flp.Controls.Add(this.action2Nud);
|
||||
this.action2Flp.Controls.Add(this.action2ValueComboBox);
|
||||
this.action2Flp.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.action2Flp.Location = new System.Drawing.Point(219, 249);
|
||||
this.action2Flp.Name = "action2Flp";
|
||||
this.action2Flp.Size = new System.Drawing.Size(172, 51);
|
||||
this.action2Flp.TabIndex = 39;
|
||||
//
|
||||
// action2Nud
|
||||
//
|
||||
this.action2Nud.Location = new System.Drawing.Point(2, 2);
|
||||
this.action2Nud.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.action2Nud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.action2Nud.Minimum = new decimal(new int[] {
|
||||
-2147483648,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
this.action2Nud.Name = "action2Nud";
|
||||
this.action2Nud.Size = new System.Drawing.Size(70, 20);
|
||||
this.action2Nud.TabIndex = 32;
|
||||
//
|
||||
// action2ValueComboBox
|
||||
//
|
||||
this.action2ValueComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.action2ValueComboBox.FormattingEnabled = true;
|
||||
this.action2ValueComboBox.Location = new System.Drawing.Point(3, 27);
|
||||
this.action2ValueComboBox.Name = "action2ValueComboBox";
|
||||
this.action2ValueComboBox.Size = new System.Drawing.Size(166, 21);
|
||||
this.action2ValueComboBox.TabIndex = 33;
|
||||
//
|
||||
// triggersListView
|
||||
//
|
||||
this.triggersListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.nameColumnHeader});
|
||||
this.triggersListView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.triggersListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
|
||||
this.triggersListView.HideSelection = false;
|
||||
this.triggersListView.LabelEdit = true;
|
||||
this.triggersListView.Location = new System.Drawing.Point(2, 2);
|
||||
this.triggersListView.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.triggersListView.MultiSelect = false;
|
||||
this.triggersListView.Name = "triggersListView";
|
||||
this.triggersListView.ShowItemToolTips = true;
|
||||
this.triggersListView.Size = new System.Drawing.Size(135, 455);
|
||||
this.triggersListView.TabIndex = 4;
|
||||
this.triggersListView.UseCompatibleStateImageBehavior = false;
|
||||
this.triggersListView.View = System.Windows.Forms.View.Details;
|
||||
this.triggersListView.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.teamTypesListView_AfterLabelEdit);
|
||||
this.triggersListView.SelectedIndexChanged += new System.EventHandler(this.triggersListView_SelectedIndexChanged);
|
||||
this.triggersListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.teamTypesListView_KeyDown);
|
||||
this.triggersListView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.teamTypesListView_MouseDown);
|
||||
//
|
||||
// triggersContextMenuStrip
|
||||
//
|
||||
this.triggersContextMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24);
|
||||
this.triggersContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.addTriggerToolStripMenuItem,
|
||||
this.removeTriggerToolStripMenuItem});
|
||||
this.triggersContextMenuStrip.Name = "teamTypesContextMenuStrip";
|
||||
this.triggersContextMenuStrip.Size = new System.Drawing.Size(157, 48);
|
||||
//
|
||||
// addTriggerToolStripMenuItem
|
||||
//
|
||||
this.addTriggerToolStripMenuItem.Name = "addTriggerToolStripMenuItem";
|
||||
this.addTriggerToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
|
||||
this.addTriggerToolStripMenuItem.Text = "&Add Trigger";
|
||||
this.addTriggerToolStripMenuItem.Click += new System.EventHandler(this.addTriggerToolStripMenuItem_Click);
|
||||
//
|
||||
// removeTriggerToolStripMenuItem
|
||||
//
|
||||
this.removeTriggerToolStripMenuItem.Name = "removeTriggerToolStripMenuItem";
|
||||
this.removeTriggerToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
|
||||
this.removeTriggerToolStripMenuItem.Text = "&Remove Trigger";
|
||||
this.removeTriggerToolStripMenuItem.Click += new System.EventHandler(this.removeTriggerToolStripMenuItem_Click);
|
||||
//
|
||||
// TriggersDialog
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(562, 499);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "TriggersDialog";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Triggers";
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.PerformLayout();
|
||||
this.settingsPanel.ResumeLayout(false);
|
||||
this.settingsPanel.PerformLayout();
|
||||
this.triggersTableLayoutPanel.ResumeLayout(false);
|
||||
this.triggersTableLayoutPanel.PerformLayout();
|
||||
this.event1Flp.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.event1Nud)).EndInit();
|
||||
this.event2Flp.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.event2Nud)).EndInit();
|
||||
this.action1Flp.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.action1Nud)).EndInit();
|
||||
this.action2Flp.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.action2Nud)).EndInit();
|
||||
this.triggersContextMenuStrip.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.Panel settingsPanel;
|
||||
private System.Windows.Forms.ListView triggersListView;
|
||||
private System.Windows.Forms.ColumnHeader nameColumnHeader;
|
||||
private System.Windows.Forms.ContextMenuStrip triggersContextMenuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem addTriggerToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem removeTriggerToolStripMenuItem;
|
||||
private System.Windows.Forms.TableLayoutPanel triggersTableLayoutPanel;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox houseComboBox;
|
||||
private System.Windows.Forms.Label typeLabel;
|
||||
private System.Windows.Forms.Label event1Label;
|
||||
private System.Windows.Forms.Label event2Label;
|
||||
private System.Windows.Forms.Label action2Label;
|
||||
private System.Windows.Forms.ComboBox action2ComboBox;
|
||||
private System.Windows.Forms.Label existenceLabel;
|
||||
private System.Windows.Forms.ComboBox existenceComboBox;
|
||||
private System.Windows.Forms.ComboBox typeComboBox;
|
||||
private System.Windows.Forms.ComboBox event1ComboBox;
|
||||
private System.Windows.Forms.ComboBox event2ComboBox;
|
||||
private System.Windows.Forms.ComboBox action1ComboBox;
|
||||
private System.Windows.Forms.Label action1Label;
|
||||
private System.Windows.Forms.Label teamLabel;
|
||||
private System.Windows.Forms.ComboBox teamComboBox;
|
||||
private System.Windows.Forms.FlowLayoutPanel event1Flp;
|
||||
private System.Windows.Forms.NumericUpDown event1Nud;
|
||||
private System.Windows.Forms.FlowLayoutPanel event2Flp;
|
||||
private System.Windows.Forms.NumericUpDown event2Nud;
|
||||
private System.Windows.Forms.FlowLayoutPanel action1Flp;
|
||||
private System.Windows.Forms.NumericUpDown action1Nud;
|
||||
private System.Windows.Forms.FlowLayoutPanel action2Flp;
|
||||
private System.Windows.Forms.NumericUpDown action2Nud;
|
||||
private System.Windows.Forms.ComboBox event1ValueComboBox;
|
||||
private System.Windows.Forms.ComboBox event2ValueComboBox;
|
||||
private System.Windows.Forms.ComboBox action1ValueComboBox;
|
||||
private System.Windows.Forms.ComboBox action2ValueComboBox;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,510 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Model;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
public partial class TriggersDialog : Form
|
||||
{
|
||||
private readonly IGamePlugin plugin;
|
||||
private readonly int maxTriggers;
|
||||
|
||||
private readonly List<Trigger> triggers;
|
||||
public IEnumerable<Trigger> Triggers => triggers;
|
||||
|
||||
private ListViewItem SelectedItem => (triggersListView.SelectedItems.Count > 0) ? triggersListView.SelectedItems[0] : null;
|
||||
|
||||
private Trigger SelectedTrigger => SelectedItem?.Tag as Trigger;
|
||||
|
||||
public TriggersDialog(IGamePlugin plugin, int maxTriggers)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
this.maxTriggers = maxTriggers;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
existenceLabel.Text = "Loop";
|
||||
event1Label.Text = "Event";
|
||||
action1Label.Text = "Action";
|
||||
typeLabel.Visible = typeComboBox.Visible = false;
|
||||
event2Label.Visible = event2ComboBox.Visible = event2Flp.Visible = false;
|
||||
action2Label.Visible = action2ComboBox.Visible = action2Flp.Visible = false;
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
teamLabel.Visible = teamComboBox.Visible = false;
|
||||
break;
|
||||
}
|
||||
|
||||
triggers = new List<Trigger>(plugin.Map.Triggers.Select(t => t.Clone()));
|
||||
|
||||
triggersListView.BeginUpdate();
|
||||
{
|
||||
foreach (var trigger in triggers)
|
||||
{
|
||||
var item = new ListViewItem(trigger.Name)
|
||||
{
|
||||
Tag = trigger
|
||||
};
|
||||
triggersListView.Items.Add(item).ToolTipText = trigger.Name;
|
||||
}
|
||||
}
|
||||
triggersListView.EndUpdate();
|
||||
|
||||
string[] existenceNames = Enum.GetNames(typeof(TriggerPersistantType));
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
existenceNames = new string[] { "No", "And", "Or" };
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
existenceNames = new string[] { "Temporary", "Semi-Constant", "Constant" };
|
||||
break;
|
||||
}
|
||||
|
||||
string[] typeNames = new string[]
|
||||
{
|
||||
"E => A1 [+ A2]",
|
||||
"E1 && E2 => A1 [+ A2]",
|
||||
"E1 || E2 => A1 [+ A2]",
|
||||
"E1 => A1; E2 => A2",
|
||||
};
|
||||
|
||||
houseComboBox.DataSource = "None".Yield().Concat(plugin.Map.Houses.Select(t => t.Type.Name)).ToArray();
|
||||
existenceComboBox.DataSource = Enum.GetValues(typeof(TriggerPersistantType)).Cast<int>()
|
||||
.Select(v => new { Name = existenceNames[v], Value = (TriggerPersistantType)v })
|
||||
.ToArray();
|
||||
typeComboBox.DataSource = Enum.GetValues(typeof(TriggerMultiStyleType)).Cast<int>()
|
||||
.Select(v => new { Name = typeNames[v], Value = (TriggerMultiStyleType)v })
|
||||
.ToArray();
|
||||
event1ComboBox.DataSource = plugin.Map.EventTypes.Where(t => !string.IsNullOrEmpty(t)).ToArray();
|
||||
event2ComboBox.DataSource = plugin.Map.EventTypes.Where(t => !string.IsNullOrEmpty(t)).ToArray();
|
||||
action1ComboBox.DataSource = plugin.Map.ActionTypes.Where(t => !string.IsNullOrEmpty(t)).ToArray();
|
||||
action2ComboBox.DataSource = plugin.Map.ActionTypes.Where(t => !string.IsNullOrEmpty(t)).ToArray();
|
||||
teamComboBox.DataSource = "None".Yield().Concat(plugin.Map.TeamTypes.Select(t => t.Name)).ToArray();
|
||||
|
||||
triggersTableLayoutPanel.Visible = false;
|
||||
}
|
||||
|
||||
private void triggersListView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
houseComboBox.DataBindings.Clear();
|
||||
existenceComboBox.DataBindings.Clear();
|
||||
typeComboBox.DataBindings.Clear();
|
||||
event1ComboBox.DataBindings.Clear();
|
||||
event2ComboBox.DataBindings.Clear();
|
||||
action1ComboBox.DataBindings.Clear();
|
||||
action2ComboBox.DataBindings.Clear();
|
||||
teamComboBox.DataBindings.Clear();
|
||||
|
||||
if (SelectedTrigger != null)
|
||||
{
|
||||
houseComboBox.DataBindings.Add("SelectedItem", SelectedTrigger, "House");
|
||||
existenceComboBox.DataBindings.Add("SelectedValue", SelectedTrigger, "PersistantType");
|
||||
event1ComboBox.DataBindings.Add("SelectedItem", SelectedTrigger.Event1, "EventType");
|
||||
action1ComboBox.DataBindings.Add("SelectedItem", SelectedTrigger.Action1, "ActionType");
|
||||
|
||||
UpdateTriggerControls(SelectedTrigger,
|
||||
SelectedTrigger?.Event1, SelectedTrigger?.Action1,
|
||||
event1ComboBox, event1Nud, event1ValueComboBox,
|
||||
action1ComboBox, action1Nud, action1ValueComboBox);
|
||||
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
teamComboBox.DataBindings.Add("SelectedItem", SelectedTrigger.Action1, "Team");
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
typeComboBox.DataBindings.Add("SelectedValue", SelectedTrigger, "EventControl");
|
||||
event2ComboBox.DataBindings.Add("SelectedItem", SelectedTrigger.Event2, "EventType");
|
||||
action2ComboBox.DataBindings.Add("SelectedItem", SelectedTrigger.Action2, "ActionType");
|
||||
UpdateTriggerControls(SelectedTrigger,
|
||||
SelectedTrigger?.Event2, SelectedTrigger?.Action2,
|
||||
event2ComboBox, event2Nud, event2ValueComboBox,
|
||||
action2ComboBox, action2Nud, action2ValueComboBox);
|
||||
break;
|
||||
}
|
||||
|
||||
triggersTableLayoutPanel.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
triggersTableLayoutPanel.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void teamTypesListView_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
var hitTest = triggersListView.HitTest(e.Location);
|
||||
|
||||
bool canAdd = (hitTest.Item == null) && (triggersListView.Items.Count < maxTriggers);
|
||||
bool canRemove = hitTest.Item != null;
|
||||
addTriggerToolStripMenuItem.Visible = canAdd;
|
||||
removeTriggerToolStripMenuItem.Visible = canRemove;
|
||||
|
||||
if (canAdd || canRemove)
|
||||
{
|
||||
triggersContextMenuStrip.Show(Cursor.Position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void teamTypesListView_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if ((e.KeyData == Keys.F2) && (triggersListView.SelectedItems.Count > 0))
|
||||
{
|
||||
triggersListView.SelectedItems[0].BeginEdit();
|
||||
}
|
||||
}
|
||||
|
||||
private void addTriggerToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var nameChars = Enumerable.Range(97, 26).Concat(Enumerable.Range(48, 10));
|
||||
|
||||
string name = string.Empty;
|
||||
foreach (var nameChar in nameChars)
|
||||
{
|
||||
name = new string((char)nameChar, 4);
|
||||
if (!triggers.Where(t => t.Equals(name)).Any())
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var trigger = new Trigger { Name = name, House = plugin.Map.HouseTypes.First().Name };
|
||||
var item = new ListViewItem(trigger.Name)
|
||||
{
|
||||
Tag = trigger
|
||||
};
|
||||
triggers.Add(trigger);
|
||||
triggersListView.Items.Add(item).ToolTipText = trigger.Name;
|
||||
|
||||
item.Selected = true;
|
||||
item.BeginEdit();
|
||||
}
|
||||
|
||||
private void removeTriggerToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (SelectedItem != null)
|
||||
{
|
||||
triggers.Remove(SelectedTrigger);
|
||||
triggersListView.Items.Remove(SelectedItem);
|
||||
}
|
||||
}
|
||||
|
||||
private void teamTypesListView_AfterLabelEdit(object sender, LabelEditEventArgs e)
|
||||
{
|
||||
int maxLength = int.MaxValue;
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
maxLength = 4;
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
maxLength = 23;
|
||||
break;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(e.Label))
|
||||
{
|
||||
e.CancelEdit = true;
|
||||
}
|
||||
else if (e.Label.Length > maxLength)
|
||||
{
|
||||
e.CancelEdit = true;
|
||||
MessageBox.Show(string.Format("Trigger name is longer than {0} characters.", maxLength), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
else if (triggers.Where(t => (t != SelectedTrigger) && t.Equals(e.Label)).Any())
|
||||
{
|
||||
e.CancelEdit = true;
|
||||
MessageBox.Show(string.Format("Trigger with name '{0]' already exists", e.Label), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedTrigger.Name = e.Label;
|
||||
triggersListView.Items[e.Item].ToolTipText = SelectedTrigger.Name;
|
||||
}
|
||||
}
|
||||
|
||||
private void typeComboBox_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (plugin.GameType == GameType.RedAlert)
|
||||
{
|
||||
var eventType = (TriggerMultiStyleType)typeComboBox.SelectedValue;
|
||||
event2Label.Visible = event2ComboBox.Visible = event2Flp.Visible = eventType != TriggerMultiStyleType.Only;
|
||||
}
|
||||
}
|
||||
|
||||
private void trigger1ComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateTriggerControls(SelectedTrigger,
|
||||
SelectedTrigger?.Event1, SelectedTrigger?.Action1,
|
||||
event1ComboBox, event1Nud, event1ValueComboBox,
|
||||
action1ComboBox, action1Nud, action1ValueComboBox);
|
||||
}
|
||||
|
||||
private void trigger2ComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateTriggerControls(SelectedTrigger,
|
||||
SelectedTrigger?.Event2, SelectedTrigger?.Action2,
|
||||
event2ComboBox, event2Nud, event2ValueComboBox,
|
||||
action2ComboBox, action2Nud, action2ValueComboBox);
|
||||
}
|
||||
|
||||
private void UpdateTriggerControls(Trigger trigger, TriggerEvent triggerEvent, TriggerAction triggerAction, ComboBox eventComboBox, NumericUpDown eventNud, ComboBox eventValueComboBox, ComboBox actionComboBox, NumericUpDown actionNud, ComboBox actionValueComboBox)
|
||||
{
|
||||
eventNud.Visible = false;
|
||||
eventNud.DataBindings.Clear();
|
||||
eventValueComboBox.Visible = false;
|
||||
eventValueComboBox.DataBindings.Clear();
|
||||
eventValueComboBox.DataSource = null;
|
||||
eventValueComboBox.DisplayMember = null;
|
||||
eventValueComboBox.ValueMember = null;
|
||||
|
||||
if (triggerEvent != null)
|
||||
{
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
switch (eventComboBox.SelectedItem)
|
||||
{
|
||||
case TiberianDawn.EventTypes.EVENT_TIME:
|
||||
case TiberianDawn.EventTypes.EVENT_CREDITS:
|
||||
case TiberianDawn.EventTypes.EVENT_NUNITS_DESTROYED:
|
||||
case TiberianDawn.EventTypes.EVENT_NBUILDINGS_DESTROYED:
|
||||
eventNud.Visible = true;
|
||||
eventNud.DataBindings.Add("Value", triggerEvent, "Data");
|
||||
break;
|
||||
case TiberianDawn.EventTypes.EVENT_BUILD:
|
||||
eventValueComboBox.Visible = true;
|
||||
eventValueComboBox.DisplayMember = "Name";
|
||||
eventValueComboBox.ValueMember = "Value";
|
||||
eventValueComboBox.DataSource = plugin.Map.BuildingTypes.Select(t => new { Name = t.DisplayName, Value = (long)t.ID }).ToArray();
|
||||
eventValueComboBox.DataBindings.Add("SelectedValue", triggerEvent, "Data");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
switch (eventComboBox.SelectedItem)
|
||||
{
|
||||
case RedAlert.EventTypes.TEVENT_LEAVES_MAP:
|
||||
eventValueComboBox.Visible = true;
|
||||
eventValueComboBox.DataSource = plugin.Map.TeamTypes.Select(t => t.Name).ToArray();
|
||||
eventValueComboBox.DataBindings.Add("SelectedItem", triggerEvent, "Team");
|
||||
break;
|
||||
case RedAlert.EventTypes.TEVENT_PLAYER_ENTERED:
|
||||
case RedAlert.EventTypes.TEVENT_CROSS_HORIZONTAL:
|
||||
case RedAlert.EventTypes.TEVENT_CROSS_VERTICAL:
|
||||
case RedAlert.EventTypes.TEVENT_ENTERS_ZONE:
|
||||
case RedAlert.EventTypes.TEVENT_LOW_POWER:
|
||||
case RedAlert.EventTypes.TEVENT_THIEVED:
|
||||
case RedAlert.EventTypes.TEVENT_HOUSE_DISCOVERED:
|
||||
case RedAlert.EventTypes.TEVENT_BUILDINGS_DESTROYED:
|
||||
case RedAlert.EventTypes.TEVENT_UNITS_DESTROYED:
|
||||
case RedAlert.EventTypes.TEVENT_ALL_DESTROYED:
|
||||
eventValueComboBox.Visible = true;
|
||||
eventValueComboBox.DisplayMember = "Name";
|
||||
eventValueComboBox.ValueMember = "Value";
|
||||
eventValueComboBox.DataSource = new { Name = "None", Value = (long)-1 }.Yield().Concat(plugin.Map.Houses.Select(t => new { t.Type.Name, Value = (long)t.Type.ID })).ToArray();
|
||||
eventValueComboBox.DataBindings.Add("SelectedValue", triggerEvent, "Data");
|
||||
break;
|
||||
case RedAlert.EventTypes.TEVENT_BUILDING_EXISTS:
|
||||
case RedAlert.EventTypes.TEVENT_BUILD:
|
||||
eventValueComboBox.Visible = true;
|
||||
eventValueComboBox.DisplayMember = "Name";
|
||||
eventValueComboBox.ValueMember = "Value";
|
||||
eventValueComboBox.DataSource = plugin.Map.BuildingTypes.Select(t => new { Name = t.DisplayName, Value = (long)t.ID }).ToArray();
|
||||
eventValueComboBox.DataBindings.Add("SelectedValue", triggerEvent, "Data");
|
||||
break;
|
||||
case RedAlert.EventTypes.TEVENT_BUILD_UNIT:
|
||||
eventValueComboBox.Visible = true;
|
||||
eventValueComboBox.DisplayMember = "Name";
|
||||
eventValueComboBox.ValueMember = "Value";
|
||||
eventValueComboBox.DataSource = plugin.Map.UnitTypes.Where(t => t.IsUnit).Select(t => new { Name = t.DisplayName, Value = (long)t.ID }).ToArray();
|
||||
eventValueComboBox.DataBindings.Add("SelectedValue", triggerEvent, "Data");
|
||||
break;
|
||||
case RedAlert.EventTypes.TEVENT_BUILD_INFANTRY:
|
||||
eventValueComboBox.Visible = true;
|
||||
eventValueComboBox.DisplayMember = "Name";
|
||||
eventValueComboBox.ValueMember = "Value";
|
||||
eventValueComboBox.DataSource = plugin.Map.InfantryTypes.Select(t => new { Name = t.DisplayName, Value = (long)t.ID }).ToArray();
|
||||
eventValueComboBox.DataBindings.Add("SelectedValue", triggerEvent, "Data");
|
||||
break;
|
||||
case RedAlert.EventTypes.TEVENT_BUILD_AIRCRAFT:
|
||||
eventValueComboBox.Visible = true;
|
||||
eventValueComboBox.DisplayMember = "Name";
|
||||
eventValueComboBox.ValueMember = "Value";
|
||||
eventValueComboBox.DataSource = plugin.Map.UnitTypes.Where(t => t.IsAircraft).Select(t => new { Name = t.DisplayName, Value = (long)t.ID }).ToArray();
|
||||
eventValueComboBox.DataBindings.Add("SelectedValue", triggerEvent, "Data");
|
||||
break;
|
||||
case RedAlert.EventTypes.TEVENT_NUNITS_DESTROYED:
|
||||
case RedAlert.EventTypes.TEVENT_NBUILDINGS_DESTROYED:
|
||||
case RedAlert.EventTypes.TEVENT_CREDITS:
|
||||
case RedAlert.EventTypes.TEVENT_TIME:
|
||||
case RedAlert.EventTypes.TEVENT_GLOBAL_SET:
|
||||
case RedAlert.EventTypes.TEVENT_GLOBAL_CLEAR:
|
||||
eventNud.Visible = true;
|
||||
eventNud.DataBindings.Add("Value", triggerEvent, "Data");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
actionNud.Visible = false;
|
||||
actionNud.DataBindings.Clear();
|
||||
actionNud.Minimum = long.MinValue;
|
||||
actionNud.Maximum = long.MaxValue;
|
||||
actionValueComboBox.Visible = false;
|
||||
actionValueComboBox.DataBindings.Clear();
|
||||
actionValueComboBox.DataSource = null;
|
||||
actionValueComboBox.DisplayMember = null;
|
||||
actionValueComboBox.ValueMember = null;
|
||||
|
||||
if (triggerAction != null)
|
||||
{
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.RedAlert:
|
||||
switch (actionComboBox.SelectedItem)
|
||||
{
|
||||
case RedAlert.ActionTypes.TACTION_CREATE_TEAM:
|
||||
case RedAlert.ActionTypes.TACTION_DESTROY_TEAM:
|
||||
case RedAlert.ActionTypes.TACTION_REINFORCEMENTS:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DataSource = plugin.Map.TeamTypes.Select(t => t.Name).ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedItem", triggerAction, "Team");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_WIN:
|
||||
case RedAlert.ActionTypes.TACTION_LOSE:
|
||||
case RedAlert.ActionTypes.TACTION_BEGIN_PRODUCTION:
|
||||
case RedAlert.ActionTypes.TACTION_FIRE_SALE:
|
||||
case RedAlert.ActionTypes.TACTION_AUTOCREATE:
|
||||
case RedAlert.ActionTypes.TACTION_ALL_HUNT:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DisplayMember = "Name";
|
||||
actionValueComboBox.ValueMember = "Value";
|
||||
actionValueComboBox.DataSource = new { Name = "None", Value = (long)-1 }.Yield().Concat(plugin.Map.Houses.Select(t => new { t.Type.Name, Value = (long)t.Type.ID })).ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedValue", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_FORCE_TRIGGER:
|
||||
case RedAlert.ActionTypes.TACTION_DESTROY_TRIGGER:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DataSource = plugin.Map.Triggers.Select(t => t.Name).ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedItem", triggerAction, "Trigger");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_DZ:
|
||||
case RedAlert.ActionTypes.TACTION_REVEAL_SOME:
|
||||
case RedAlert.ActionTypes.TACTION_REVEAL_ZONE:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DisplayMember = "Name";
|
||||
actionValueComboBox.ValueMember = "Value";
|
||||
actionValueComboBox.DataSource = new { Name = "None", Value = (long)-1 }.Yield().Concat(plugin.Map.Waypoints.Select((t, i) => new { t.Name, Value = (long)i })).ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedValue", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_1_SPECIAL:
|
||||
case RedAlert.ActionTypes.TACTION_FULL_SPECIAL:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DisplayMember = "Name";
|
||||
actionValueComboBox.ValueMember = "Value";
|
||||
actionValueComboBox.DataSource = Enum.GetValues(typeof(RedAlert.ActionDataTypes.SpecialWeaponType)).Cast<int>()
|
||||
.Select(v => new { Name = Enum.GetName(typeof(RedAlert.ActionDataTypes.SpecialWeaponType), v), Value = (long)v })
|
||||
.ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedValue", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_PLAY_MUSIC:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DisplayMember = "Name";
|
||||
actionValueComboBox.ValueMember = "Value";
|
||||
actionValueComboBox.DataSource = Enum.GetValues(typeof(RedAlert.ActionDataTypes.ThemeType)).Cast<int>()
|
||||
.Select(v => new { Name = Enum.GetName(typeof(RedAlert.ActionDataTypes.ThemeType), v), Value = (long)v })
|
||||
.ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedValue", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_PLAY_MOVIE:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DisplayMember = "Name";
|
||||
actionValueComboBox.ValueMember = "Value";
|
||||
actionValueComboBox.DataSource = Enum.GetValues(typeof(RedAlert.ActionDataTypes.VQType)).Cast<int>()
|
||||
.Select(v => new { Name = Enum.GetName(typeof(RedAlert.ActionDataTypes.VQType), v), Value = (long)v })
|
||||
.ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedValue", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_PLAY_SOUND:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DisplayMember = "Name";
|
||||
actionValueComboBox.ValueMember = "Value";
|
||||
actionValueComboBox.DataSource = Enum.GetValues(typeof(RedAlert.ActionDataTypes.VocType)).Cast<int>()
|
||||
.Select(v => new { Name = Enum.GetName(typeof(RedAlert.ActionDataTypes.VocType), v), Value = (long)v })
|
||||
.ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedValue", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_PLAY_SPEECH:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DisplayMember = "Name";
|
||||
actionValueComboBox.ValueMember = "Value";
|
||||
actionValueComboBox.DataSource = Enum.GetValues(typeof(RedAlert.ActionDataTypes.VoxType)).Cast<int>()
|
||||
.Select(v => new { Name = Enum.GetName(typeof(RedAlert.ActionDataTypes.VoxType), v), Value = (long)v })
|
||||
.ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedValue", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_PREFERRED_TARGET:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DisplayMember = "Name";
|
||||
actionValueComboBox.ValueMember = "Value";
|
||||
actionValueComboBox.DataSource = Enum.GetValues(typeof(RedAlert.ActionDataTypes.QuarryType)).Cast<int>()
|
||||
.Select(v => new { Name = Enum.GetName(typeof(RedAlert.ActionDataTypes.QuarryType), v), Value = (long)v })
|
||||
.ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedValue", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_TEXT_TRIGGER:
|
||||
actionNud.Visible = true;
|
||||
actionNud.Minimum = 1;
|
||||
actionNud.Maximum = 209;
|
||||
actionNud.DataBindings.Add("Value", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_ADD_TIMER:
|
||||
case RedAlert.ActionTypes.TACTION_SUB_TIMER:
|
||||
case RedAlert.ActionTypes.TACTION_SET_TIMER:
|
||||
case RedAlert.ActionTypes.TACTION_SET_GLOBAL:
|
||||
case RedAlert.ActionTypes.TACTION_CLEAR_GLOBAL:
|
||||
case RedAlert.ActionTypes.TACTION_BASE_BUILDING:
|
||||
actionNud.Visible = true;
|
||||
actionNud.DataBindings.Add("Value", triggerAction, "Data");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="triggersContextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -0,0 +1,33 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace MobiusEditor.Event
|
||||
{
|
||||
public class RenderEventArgs : EventArgs
|
||||
{
|
||||
public Graphics Graphics { get; private set; }
|
||||
|
||||
public ISet<Point> Cells { get; private set; }
|
||||
|
||||
public RenderEventArgs(Graphics graphics, ISet<Point> cells)
|
||||
{
|
||||
Graphics = graphics;
|
||||
Cells = cells;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Controls;
|
||||
using MobiusEditor.Model;
|
||||
|
||||
namespace MobiusEditor.Event
|
||||
{
|
||||
public class UndoRedoEventArgs
|
||||
{
|
||||
public MapPanel MapPanel { get; private set; }
|
||||
|
||||
public Map Map { get; private set; }
|
||||
|
||||
public UndoRedoEventArgs(MapPanel mapPanel, Map map)
|
||||
{
|
||||
MapPanel = mapPanel;
|
||||
Map = map;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
|
||||
namespace MobiusEditor
|
||||
{
|
||||
public static class Globals
|
||||
{
|
||||
static Globals()
|
||||
{
|
||||
TileScale = Properties.Settings.Default.Quality;
|
||||
}
|
||||
|
||||
public const string TilesetsXMLPath = @"DATA\XML\TILESETS.XML";
|
||||
public const string TexturesPath = @"DATA\ART\TEXTURES\SRGB";
|
||||
public const string MegafilePath = @"DATA";
|
||||
public const string GameTextFilenameFormat = @"DATA\TEXT\MASTERTEXTFILE_{0}.LOC";
|
||||
|
||||
public const int OriginalTileWidth = 128;
|
||||
public const int OriginalTileHeight = 128;
|
||||
public static readonly Size OriginalTileSize = new Size(OriginalTileWidth, OriginalTileHeight);
|
||||
|
||||
public static int TileScale { get; set; }
|
||||
public static int TileWidth => OriginalTileWidth / TileScale;
|
||||
public static int TileHeight => OriginalTileHeight / TileScale;
|
||||
public static Size TileSize => new Size(TileWidth, TileHeight);
|
||||
|
||||
public const int PixelWidth = 24;
|
||||
public const int PixelHeight = 24;
|
||||
|
||||
public static readonly Size MapPreviewSize = new Size(512, 512);
|
||||
public static readonly Size WorkshopPreviewSize = new Size(512, 512);
|
||||
|
||||
public static readonly string[] Edges = new string[] { "North", "South", "West", "East" };
|
||||
public const int NumInfantryStops = 5;
|
||||
|
||||
public const int MaxTeamClasses = 5;
|
||||
public const int MaxTeamMissions = 20;
|
||||
|
||||
public const long MaxMapSize = 131072;
|
||||
|
||||
public static MegafileManager TheMegafileManager;
|
||||
public static TextureManager TheTextureManager;
|
||||
public static TilesetManager TheTilesetManager;
|
||||
public static TeamColorManager TheTeamColorManager;
|
||||
public static GameTextManager TheGameTextManager;
|
||||
|
||||
public static readonly string RootSaveDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), @"CnCRemastered\Local_Custom_Maps");
|
||||
|
||||
#if DEVELOPER
|
||||
public static class Developer
|
||||
{
|
||||
public static bool ShowOverlapCells = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System.Drawing;
|
||||
|
||||
namespace MobiusEditor.Interface
|
||||
{
|
||||
public interface IBrowsableType
|
||||
{
|
||||
string DisplayName { get; }
|
||||
|
||||
Image Thumbnail { get; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Interface
|
||||
{
|
||||
public interface ICellOccupier
|
||||
{
|
||||
bool[,] OccupyMask { get; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System.Drawing;
|
||||
|
||||
namespace MobiusEditor.Interface
|
||||
{
|
||||
public interface ICellOverlapper
|
||||
{
|
||||
Rectangle OverlapBounds { get; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Model;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
|
||||
namespace MobiusEditor.Interface
|
||||
{
|
||||
public enum FileType
|
||||
{
|
||||
None,
|
||||
INI,
|
||||
BIN,
|
||||
MEG,
|
||||
PGM
|
||||
}
|
||||
|
||||
public enum GameType
|
||||
{
|
||||
None,
|
||||
TiberianDawn,
|
||||
RedAlert
|
||||
}
|
||||
|
||||
public interface IGamePlugin : IDisposable
|
||||
{
|
||||
GameType GameType { get; }
|
||||
|
||||
Map Map { get; }
|
||||
|
||||
Image MapImage { get; }
|
||||
|
||||
bool Dirty { get; set; }
|
||||
|
||||
void New(string theater);
|
||||
|
||||
IEnumerable<string> Load(string path, FileType fileType);
|
||||
|
||||
bool Save(string path, FileType fileType);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Interface
|
||||
{
|
||||
public interface INamedType
|
||||
{
|
||||
string Name { get; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Interface
|
||||
{
|
||||
public interface ITechnoType
|
||||
{
|
||||
sbyte ID { get; }
|
||||
|
||||
string Name { get; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MobiusEditor.Interface
|
||||
{
|
||||
public interface ITool : IDisposable
|
||||
{
|
||||
MapLayerFlag Layers { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MobiusEditor.Interface
|
||||
{
|
||||
public interface IWidget : IDisposable
|
||||
{
|
||||
void Render(Graphics graphics);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,714 @@
|
|||
Electronic Arts Inc. released only TiberianDawn.dll, RedAlert.dll and
|
||||
the Command & Conquer Map Editor and their corresponding source code
|
||||
under the GPL V3 below, with additional terms at the bottom.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
|
||||
ADDITIONAL TERMS per GNU GPL Section 7
|
||||
No trademark or publicity rights are granted. This license does NOT give you
|
||||
any right, title or interest in "Command & Conquer" or any other Electronic Arts trademark. You may not distribute any
|
||||
modification of this program using any Electronic Arts trademark or claim any affiliation or association with Electronic Arts Inc.
|
||||
or its affiliates or their employees.
|
||||
|
||||
Any propagation or conveyance of this program must include this copyright
|
||||
notice and these terms.
|
||||
|
||||
If you convey this program (or any modifications of it) and assume
|
||||
contractual liability for the program to recipients of it, you agree to
|
||||
indemnify Electronic Arts for any liability that those contractual
|
||||
assumptions impose on Electronic Arts.
|
||||
|
||||
You may not misrepresent the origins of this program; modified versions of
|
||||
the program must be marked as such and not identified as the original program.
|
||||
|
||||
This disclaimer supplements the one included in the General Public License.
|
||||
TO THE FULLEST EXTENT PERMISSIBLE UNDER APPLICABLE LAW, THIS PROGRAM IS
|
||||
PROVIDED TO YOU "AS IS," WITH ALL FAULTS, WITHOUT WARRANTY OF ANY KIND, AND
|
||||
YOUR USE IS AT YOUR SOLE RISK. THE ENTIRE RISK OF SATISFACTORY QUALITY AND
|
||||
PERFORMANCE RESIDES WITH YOU. ELECTRONIC ARTS DISCLAIMS ANY AND ALL EXPRESS,
|
||||
IMPLIED OR STATUTORY WARRANTIES, INCLUDING IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
NONINFRINGEMENT OF THIRD PARTY RIGHTS, AND WARRANTIES (IF ANY) ARISING FROM A
|
||||
COURSE OF DEALING, USAGE, OR TRADE PRACTICE. ELECTRONIC ARTS DOES NOT WARRANT
|
||||
AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE PROGRAM; THAT THE PROGRAM WILL
|
||||
MEET YOUR REQUIREMENTS; THAT OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR
|
||||
ERROR-FREE, OR THAT THE PROGRAM WILL BE COMPATIBLE WITH THIRD PARTY SOFTWARE
|
||||
OR THAT ANY ERRORS IN THE PROGRAM WILL BE CORRECTED. NO ORAL OR WRITTEN ADVICE
|
||||
PROVIDED BY ELECTRONIC ARTS OR ANY AUTHORIZED REPRESENTATIVE SHALL CREATE A
|
||||
WARRANTY. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF OR LIMITATIONS ON
|
||||
IMPLIED WARRANTIES OR THE LIMITATIONS ON THE APPLICABLE STATUTORY RIGHTS OF A
|
||||
CONSUMER, SO SOME OR ALL OF THE ABOVE EXCLUSIONS AND LIMITATIONS MAY NOT APPLY
|
||||
TO YOU.
|
|
@ -0,0 +1,660 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor
|
||||
{
|
||||
partial class MainForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
activeTool?.Dispose();
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
|
||||
this.mainMenuStrip = new System.Windows.Forms.MenuStrip();
|
||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fileNewMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fileOpenMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fileSaveMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fileSaveAsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.fileExportMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.filePublishMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.fileRecentFilesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.fileExitMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.editUndoMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.editRedoMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.settingsMapSettingsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.settingsTeamTypesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.settingsTriggersMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.layersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.viewLayersBoundariesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.viewLayersOverlayMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.viewLayersTerrainMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.viewLayersWaypointsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.viewLayersObjectTriggersMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.viewLayersCellTriggersMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.developerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.developerGenerateMapPreviewMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.developerGenerateMapPreviewDirectoryMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.developerGoToINIMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.debugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.developerDebugShowOverlapCellsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mainStatusStrip = new System.Windows.Forms.StatusStrip();
|
||||
this.toolStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.cellStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.mouseToolTip = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.mainToolStrip = new System.Windows.Forms.ToolStrip();
|
||||
this.mapToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.smudgeToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.overlayToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.terrainToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.infantryToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.unitToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.buildingToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.resourcesToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.wallsToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.waypointsToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.cellTriggersToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.mapPanel = new MobiusEditor.Controls.MapPanel();
|
||||
this.copyrightStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.mainMenuStrip.SuspendLayout();
|
||||
this.mainStatusStrip.SuspendLayout();
|
||||
this.mainToolStrip.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// mainMenuStrip
|
||||
//
|
||||
this.mainMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24);
|
||||
this.mainMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.fileToolStripMenuItem,
|
||||
this.editToolStripMenuItem,
|
||||
this.settingsToolStripMenuItem,
|
||||
this.viewToolStripMenuItem,
|
||||
this.developerToolStripMenuItem});
|
||||
this.mainMenuStrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.mainMenuStrip.Name = "mainMenuStrip";
|
||||
this.mainMenuStrip.Padding = new System.Windows.Forms.Padding(8, 2, 0, 2);
|
||||
this.mainMenuStrip.Size = new System.Drawing.Size(1369, 28);
|
||||
this.mainMenuStrip.TabIndex = 1;
|
||||
this.mainMenuStrip.Text = "menuStrip1";
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.fileNewMenuItem,
|
||||
this.fileOpenMenuItem,
|
||||
this.fileSaveMenuItem,
|
||||
this.fileSaveAsMenuItem,
|
||||
this.toolStripMenuItem4,
|
||||
this.fileExportMenuItem,
|
||||
this.filePublishMenuItem,
|
||||
this.toolStripMenuItem3,
|
||||
this.fileRecentFilesMenuItem,
|
||||
this.toolStripMenuItem1,
|
||||
this.fileExitMenuItem});
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(44, 24);
|
||||
this.fileToolStripMenuItem.Text = "&File";
|
||||
//
|
||||
// fileNewMenuItem
|
||||
//
|
||||
this.fileNewMenuItem.Name = "fileNewMenuItem";
|
||||
this.fileNewMenuItem.Size = new System.Drawing.Size(162, 26);
|
||||
this.fileNewMenuItem.Text = "&New...";
|
||||
this.fileNewMenuItem.Click += new System.EventHandler(this.fileNewMenuItem_Click);
|
||||
//
|
||||
// fileOpenMenuItem
|
||||
//
|
||||
this.fileOpenMenuItem.Name = "fileOpenMenuItem";
|
||||
this.fileOpenMenuItem.Size = new System.Drawing.Size(162, 26);
|
||||
this.fileOpenMenuItem.Text = "&Open...";
|
||||
this.fileOpenMenuItem.Click += new System.EventHandler(this.fileOpenMenuItem_Click);
|
||||
//
|
||||
// fileSaveMenuItem
|
||||
//
|
||||
this.fileSaveMenuItem.Name = "fileSaveMenuItem";
|
||||
this.fileSaveMenuItem.Size = new System.Drawing.Size(162, 26);
|
||||
this.fileSaveMenuItem.Text = "&Save";
|
||||
this.fileSaveMenuItem.Click += new System.EventHandler(this.fileSaveMenuItem_Click);
|
||||
//
|
||||
// fileSaveAsMenuItem
|
||||
//
|
||||
this.fileSaveAsMenuItem.Name = "fileSaveAsMenuItem";
|
||||
this.fileSaveAsMenuItem.Size = new System.Drawing.Size(162, 26);
|
||||
this.fileSaveAsMenuItem.Text = "Save &As...";
|
||||
this.fileSaveAsMenuItem.Click += new System.EventHandler(this.fileSaveAsMenuItem_Click);
|
||||
//
|
||||
// toolStripMenuItem4
|
||||
//
|
||||
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
|
||||
this.toolStripMenuItem4.Size = new System.Drawing.Size(159, 6);
|
||||
//
|
||||
// fileExportMenuItem
|
||||
//
|
||||
this.fileExportMenuItem.Name = "fileExportMenuItem";
|
||||
this.fileExportMenuItem.Size = new System.Drawing.Size(162, 26);
|
||||
this.fileExportMenuItem.Text = "&Export...";
|
||||
this.fileExportMenuItem.Click += new System.EventHandler(this.fileExportMenuItem_Click);
|
||||
//
|
||||
// filePublishMenuItem
|
||||
//
|
||||
this.filePublishMenuItem.Name = "filePublishMenuItem";
|
||||
this.filePublishMenuItem.Size = new System.Drawing.Size(162, 26);
|
||||
this.filePublishMenuItem.Text = "&Publish...";
|
||||
this.filePublishMenuItem.Click += new System.EventHandler(this.filePublishMenuItem_Click);
|
||||
//
|
||||
// toolStripMenuItem3
|
||||
//
|
||||
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
|
||||
this.toolStripMenuItem3.Size = new System.Drawing.Size(159, 6);
|
||||
//
|
||||
// fileRecentFilesMenuItem
|
||||
//
|
||||
this.fileRecentFilesMenuItem.Name = "fileRecentFilesMenuItem";
|
||||
this.fileRecentFilesMenuItem.Size = new System.Drawing.Size(162, 26);
|
||||
this.fileRecentFilesMenuItem.Text = "&Recent Files";
|
||||
//
|
||||
// toolStripMenuItem1
|
||||
//
|
||||
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(159, 6);
|
||||
//
|
||||
// fileExitMenuItem
|
||||
//
|
||||
this.fileExitMenuItem.Name = "fileExitMenuItem";
|
||||
this.fileExitMenuItem.Size = new System.Drawing.Size(162, 26);
|
||||
this.fileExitMenuItem.Text = "&Exit";
|
||||
this.fileExitMenuItem.Click += new System.EventHandler(this.fileExitMenuItem_Click);
|
||||
//
|
||||
// editToolStripMenuItem
|
||||
//
|
||||
this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.editUndoMenuItem,
|
||||
this.editRedoMenuItem});
|
||||
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
|
||||
this.editToolStripMenuItem.Size = new System.Drawing.Size(47, 24);
|
||||
this.editToolStripMenuItem.Text = "&Edit";
|
||||
//
|
||||
// editUndoMenuItem
|
||||
//
|
||||
this.editUndoMenuItem.Name = "editUndoMenuItem";
|
||||
this.editUndoMenuItem.ShortcutKeyDisplayString = "Ctrl + Z";
|
||||
this.editUndoMenuItem.Size = new System.Drawing.Size(179, 26);
|
||||
this.editUndoMenuItem.Text = "&Undo";
|
||||
this.editUndoMenuItem.Click += new System.EventHandler(this.editUndoMenuItem_Click);
|
||||
//
|
||||
// editRedoMenuItem
|
||||
//
|
||||
this.editRedoMenuItem.Name = "editRedoMenuItem";
|
||||
this.editRedoMenuItem.ShortcutKeyDisplayString = "Ctrl + Y";
|
||||
this.editRedoMenuItem.Size = new System.Drawing.Size(179, 26);
|
||||
this.editRedoMenuItem.Text = "&Redo";
|
||||
this.editRedoMenuItem.Click += new System.EventHandler(this.editRedoMenuItem_Click);
|
||||
//
|
||||
// settingsToolStripMenuItem
|
||||
//
|
||||
this.settingsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.settingsMapSettingsMenuItem,
|
||||
this.settingsTeamTypesMenuItem,
|
||||
this.settingsTriggersMenuItem});
|
||||
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
|
||||
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(74, 24);
|
||||
this.settingsToolStripMenuItem.Text = "&Settings";
|
||||
//
|
||||
// settingsMapSettingsMenuItem
|
||||
//
|
||||
this.settingsMapSettingsMenuItem.Name = "settingsMapSettingsMenuItem";
|
||||
this.settingsMapSettingsMenuItem.Size = new System.Drawing.Size(180, 26);
|
||||
this.settingsMapSettingsMenuItem.Text = "&Map Settings...";
|
||||
this.settingsMapSettingsMenuItem.Click += new System.EventHandler(this.settingsMapSettingsMenuItem_Click);
|
||||
//
|
||||
// settingsTeamTypesMenuItem
|
||||
//
|
||||
this.settingsTeamTypesMenuItem.Name = "settingsTeamTypesMenuItem";
|
||||
this.settingsTeamTypesMenuItem.Size = new System.Drawing.Size(180, 26);
|
||||
this.settingsTeamTypesMenuItem.Text = "&Team Types...";
|
||||
this.settingsTeamTypesMenuItem.Click += new System.EventHandler(this.settingsTeamTypesMenuItem_Click);
|
||||
//
|
||||
// settingsTriggersMenuItem
|
||||
//
|
||||
this.settingsTriggersMenuItem.Name = "settingsTriggersMenuItem";
|
||||
this.settingsTriggersMenuItem.Size = new System.Drawing.Size(180, 26);
|
||||
this.settingsTriggersMenuItem.Text = "T&riggers...";
|
||||
this.settingsTriggersMenuItem.Click += new System.EventHandler(this.settingsTriggersMenuItem_Click);
|
||||
//
|
||||
// viewToolStripMenuItem
|
||||
//
|
||||
this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.layersToolStripMenuItem});
|
||||
this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
|
||||
this.viewToolStripMenuItem.Size = new System.Drawing.Size(53, 24);
|
||||
this.viewToolStripMenuItem.Text = "&View";
|
||||
//
|
||||
// layersToolStripMenuItem
|
||||
//
|
||||
this.layersToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.viewLayersBoundariesMenuItem,
|
||||
this.viewLayersOverlayMenuItem,
|
||||
this.viewLayersTerrainMenuItem,
|
||||
this.viewLayersWaypointsMenuItem,
|
||||
this.viewLayersObjectTriggersMenuItem,
|
||||
this.viewLayersCellTriggersMenuItem});
|
||||
this.layersToolStripMenuItem.Name = "layersToolStripMenuItem";
|
||||
this.layersToolStripMenuItem.Size = new System.Drawing.Size(125, 26);
|
||||
this.layersToolStripMenuItem.Text = "&Layers";
|
||||
//
|
||||
// viewLayersBoundariesMenuItem
|
||||
//
|
||||
this.viewLayersBoundariesMenuItem.Checked = true;
|
||||
this.viewLayersBoundariesMenuItem.CheckOnClick = true;
|
||||
this.viewLayersBoundariesMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.viewLayersBoundariesMenuItem.Name = "viewLayersBoundariesMenuItem";
|
||||
this.viewLayersBoundariesMenuItem.Size = new System.Drawing.Size(185, 26);
|
||||
this.viewLayersBoundariesMenuItem.Text = "&Boundaries";
|
||||
this.viewLayersBoundariesMenuItem.CheckedChanged += new System.EventHandler(this.viewLayersMenuItem_CheckedChanged);
|
||||
//
|
||||
// viewLayersOverlayMenuItem
|
||||
//
|
||||
this.viewLayersOverlayMenuItem.Checked = true;
|
||||
this.viewLayersOverlayMenuItem.CheckOnClick = true;
|
||||
this.viewLayersOverlayMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.viewLayersOverlayMenuItem.Name = "viewLayersOverlayMenuItem";
|
||||
this.viewLayersOverlayMenuItem.Size = new System.Drawing.Size(185, 26);
|
||||
this.viewLayersOverlayMenuItem.Text = "&Overlay";
|
||||
this.viewLayersOverlayMenuItem.CheckedChanged += new System.EventHandler(this.viewLayersMenuItem_CheckedChanged);
|
||||
//
|
||||
// viewLayersTerrainMenuItem
|
||||
//
|
||||
this.viewLayersTerrainMenuItem.Checked = true;
|
||||
this.viewLayersTerrainMenuItem.CheckOnClick = true;
|
||||
this.viewLayersTerrainMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.viewLayersTerrainMenuItem.Name = "viewLayersTerrainMenuItem";
|
||||
this.viewLayersTerrainMenuItem.Size = new System.Drawing.Size(185, 26);
|
||||
this.viewLayersTerrainMenuItem.Text = "&Terrain";
|
||||
this.viewLayersTerrainMenuItem.CheckedChanged += new System.EventHandler(this.viewLayersMenuItem_CheckedChanged);
|
||||
//
|
||||
// viewLayersWaypointsMenuItem
|
||||
//
|
||||
this.viewLayersWaypointsMenuItem.Checked = true;
|
||||
this.viewLayersWaypointsMenuItem.CheckOnClick = true;
|
||||
this.viewLayersWaypointsMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.viewLayersWaypointsMenuItem.Name = "viewLayersWaypointsMenuItem";
|
||||
this.viewLayersWaypointsMenuItem.Size = new System.Drawing.Size(185, 26);
|
||||
this.viewLayersWaypointsMenuItem.Text = "&Waypoints";
|
||||
this.viewLayersWaypointsMenuItem.CheckedChanged += new System.EventHandler(this.viewLayersMenuItem_CheckedChanged);
|
||||
//
|
||||
// viewLayersObjectTriggersMenuItem
|
||||
//
|
||||
this.viewLayersObjectTriggersMenuItem.Checked = true;
|
||||
this.viewLayersObjectTriggersMenuItem.CheckOnClick = true;
|
||||
this.viewLayersObjectTriggersMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.viewLayersObjectTriggersMenuItem.Name = "viewLayersObjectTriggersMenuItem";
|
||||
this.viewLayersObjectTriggersMenuItem.Size = new System.Drawing.Size(185, 26);
|
||||
this.viewLayersObjectTriggersMenuItem.Text = "O&bject Triggers";
|
||||
this.viewLayersObjectTriggersMenuItem.CheckedChanged += new System.EventHandler(this.viewLayersMenuItem_CheckedChanged);
|
||||
//
|
||||
// viewLayersCellTriggersMenuItem
|
||||
//
|
||||
this.viewLayersCellTriggersMenuItem.Checked = true;
|
||||
this.viewLayersCellTriggersMenuItem.CheckOnClick = true;
|
||||
this.viewLayersCellTriggersMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.viewLayersCellTriggersMenuItem.Name = "viewLayersCellTriggersMenuItem";
|
||||
this.viewLayersCellTriggersMenuItem.Size = new System.Drawing.Size(185, 26);
|
||||
this.viewLayersCellTriggersMenuItem.Text = "&Cell Triggers";
|
||||
this.viewLayersCellTriggersMenuItem.CheckedChanged += new System.EventHandler(this.viewLayersMenuItem_CheckedChanged);
|
||||
//
|
||||
// developerToolStripMenuItem
|
||||
//
|
||||
this.developerToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.developerGenerateMapPreviewMenuItem,
|
||||
this.developerGoToINIMenuItem,
|
||||
this.toolStripMenuItem2,
|
||||
this.debugToolStripMenuItem});
|
||||
this.developerToolStripMenuItem.Name = "developerToolStripMenuItem";
|
||||
this.developerToolStripMenuItem.Size = new System.Drawing.Size(90, 24);
|
||||
this.developerToolStripMenuItem.Text = "&Developer";
|
||||
//
|
||||
// developerGenerateMapPreviewMenuItem
|
||||
//
|
||||
this.developerGenerateMapPreviewMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.developerGenerateMapPreviewDirectoryMenuItem});
|
||||
this.developerGenerateMapPreviewMenuItem.Name = "developerGenerateMapPreviewMenuItem";
|
||||
this.developerGenerateMapPreviewMenuItem.Size = new System.Drawing.Size(234, 26);
|
||||
this.developerGenerateMapPreviewMenuItem.Text = "&Generate map preview";
|
||||
this.developerGenerateMapPreviewMenuItem.Click += new System.EventHandler(this.developerGenerateMapPreviewMenuItem_Click);
|
||||
//
|
||||
// developerGenerateMapPreviewDirectoryMenuItem
|
||||
//
|
||||
this.developerGenerateMapPreviewDirectoryMenuItem.Name = "developerGenerateMapPreviewDirectoryMenuItem";
|
||||
this.developerGenerateMapPreviewDirectoryMenuItem.Size = new System.Drawing.Size(154, 26);
|
||||
this.developerGenerateMapPreviewDirectoryMenuItem.Text = "&Directory...";
|
||||
this.developerGenerateMapPreviewDirectoryMenuItem.Click += new System.EventHandler(this.developerGenerateMapPreviewDirectoryMenuItem_Click);
|
||||
//
|
||||
// developerGoToINIMenuItem
|
||||
//
|
||||
this.developerGoToINIMenuItem.Name = "developerGoToINIMenuItem";
|
||||
this.developerGoToINIMenuItem.Size = new System.Drawing.Size(234, 26);
|
||||
this.developerGoToINIMenuItem.Text = "Go to &INI";
|
||||
this.developerGoToINIMenuItem.Click += new System.EventHandler(this.developerGoToINIMenuItem_Click);
|
||||
//
|
||||
// toolStripMenuItem2
|
||||
//
|
||||
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
|
||||
this.toolStripMenuItem2.Size = new System.Drawing.Size(231, 6);
|
||||
//
|
||||
// debugToolStripMenuItem
|
||||
//
|
||||
this.debugToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.developerDebugShowOverlapCellsMenuItem});
|
||||
this.debugToolStripMenuItem.Name = "debugToolStripMenuItem";
|
||||
this.debugToolStripMenuItem.Size = new System.Drawing.Size(234, 26);
|
||||
this.debugToolStripMenuItem.Text = "&Debug";
|
||||
//
|
||||
// developerDebugShowOverlapCellsMenuItem
|
||||
//
|
||||
this.developerDebugShowOverlapCellsMenuItem.CheckOnClick = true;
|
||||
this.developerDebugShowOverlapCellsMenuItem.Name = "developerDebugShowOverlapCellsMenuItem";
|
||||
this.developerDebugShowOverlapCellsMenuItem.Size = new System.Drawing.Size(209, 26);
|
||||
this.developerDebugShowOverlapCellsMenuItem.Text = "Show &Overlap cells";
|
||||
this.developerDebugShowOverlapCellsMenuItem.CheckedChanged += new System.EventHandler(this.developerDebugShowOverlapCellsMenuItem_CheckedChanged);
|
||||
//
|
||||
// mainStatusStrip
|
||||
//
|
||||
this.mainStatusStrip.ImageScalingSize = new System.Drawing.Size(24, 24);
|
||||
this.mainStatusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStatusLabel,
|
||||
this.cellStatusLabel,
|
||||
this.copyrightStatusLabel});
|
||||
this.mainStatusStrip.Location = new System.Drawing.Point(0, 651);
|
||||
this.mainStatusStrip.Name = "mainStatusStrip";
|
||||
this.mainStatusStrip.Padding = new System.Windows.Forms.Padding(2, 0, 19, 0);
|
||||
this.mainStatusStrip.Size = new System.Drawing.Size(1369, 25);
|
||||
this.mainStatusStrip.TabIndex = 2;
|
||||
this.mainStatusStrip.Text = "statusStrip1";
|
||||
//
|
||||
// toolStatusLabel
|
||||
//
|
||||
this.toolStatusLabel.Name = "toolStatusLabel";
|
||||
this.toolStatusLabel.Size = new System.Drawing.Size(0, 20);
|
||||
//
|
||||
// cellStatusLabel
|
||||
//
|
||||
this.cellStatusLabel.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Left;
|
||||
this.cellStatusLabel.BorderStyle = System.Windows.Forms.Border3DStyle.Etched;
|
||||
this.cellStatusLabel.Name = "cellStatusLabel";
|
||||
this.cellStatusLabel.Size = new System.Drawing.Size(4, 20);
|
||||
//
|
||||
// mainToolStrip
|
||||
//
|
||||
this.mainToolStrip.ImageScalingSize = new System.Drawing.Size(24, 24);
|
||||
this.mainToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.mapToolStripButton,
|
||||
this.smudgeToolStripButton,
|
||||
this.overlayToolStripButton,
|
||||
this.terrainToolStripButton,
|
||||
this.infantryToolStripButton,
|
||||
this.unitToolStripButton,
|
||||
this.buildingToolStripButton,
|
||||
this.resourcesToolStripButton,
|
||||
this.wallsToolStripButton,
|
||||
this.waypointsToolStripButton,
|
||||
this.cellTriggersToolStripButton});
|
||||
this.mainToolStrip.Location = new System.Drawing.Point(0, 28);
|
||||
this.mainToolStrip.Name = "mainToolStrip";
|
||||
this.mainToolStrip.Padding = new System.Windows.Forms.Padding(0, 0, 2, 0);
|
||||
this.mainToolStrip.Size = new System.Drawing.Size(1369, 31);
|
||||
this.mainToolStrip.TabIndex = 3;
|
||||
this.mainToolStrip.Text = "toolStrip1";
|
||||
this.mainToolStrip.MouseMove += new System.Windows.Forms.MouseEventHandler(this.mainToolStrip_MouseMove);
|
||||
//
|
||||
// mapToolStripButton
|
||||
//
|
||||
this.mapToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("mapToolStripButton.Image")));
|
||||
this.mapToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.mapToolStripButton.Name = "mapToolStripButton";
|
||||
this.mapToolStripButton.Size = new System.Drawing.Size(67, 28);
|
||||
this.mapToolStripButton.Text = "Map";
|
||||
this.mapToolStripButton.Click += new System.EventHandler(this.mainToolStripButton_Click);
|
||||
//
|
||||
// smudgeToolStripButton
|
||||
//
|
||||
this.smudgeToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("smudgeToolStripButton.Image")));
|
||||
this.smudgeToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.smudgeToolStripButton.Name = "smudgeToolStripButton";
|
||||
this.smudgeToolStripButton.Size = new System.Drawing.Size(92, 28);
|
||||
this.smudgeToolStripButton.Text = "Smudge";
|
||||
this.smudgeToolStripButton.Click += new System.EventHandler(this.mainToolStripButton_Click);
|
||||
//
|
||||
// overlayToolStripButton
|
||||
//
|
||||
this.overlayToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("overlayToolStripButton.Image")));
|
||||
this.overlayToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.overlayToolStripButton.Name = "overlayToolStripButton";
|
||||
this.overlayToolStripButton.Size = new System.Drawing.Size(87, 28);
|
||||
this.overlayToolStripButton.Text = "Overlay";
|
||||
this.overlayToolStripButton.Click += new System.EventHandler(this.mainToolStripButton_Click);
|
||||
//
|
||||
// terrainToolStripButton
|
||||
//
|
||||
this.terrainToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("terrainToolStripButton.Image")));
|
||||
this.terrainToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.terrainToolStripButton.Name = "terrainToolStripButton";
|
||||
this.terrainToolStripButton.Size = new System.Drawing.Size(82, 28);
|
||||
this.terrainToolStripButton.Text = "Terrain";
|
||||
this.terrainToolStripButton.Click += new System.EventHandler(this.mainToolStripButton_Click);
|
||||
//
|
||||
// infantryToolStripButton
|
||||
//
|
||||
this.infantryToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("infantryToolStripButton.Image")));
|
||||
this.infantryToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.infantryToolStripButton.Name = "infantryToolStripButton";
|
||||
this.infantryToolStripButton.Size = new System.Drawing.Size(87, 28);
|
||||
this.infantryToolStripButton.Text = "Infantry";
|
||||
this.infantryToolStripButton.Click += new System.EventHandler(this.mainToolStripButton_Click);
|
||||
//
|
||||
// unitToolStripButton
|
||||
//
|
||||
this.unitToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("unitToolStripButton.Image")));
|
||||
this.unitToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.unitToolStripButton.Name = "unitToolStripButton";
|
||||
this.unitToolStripButton.Size = new System.Drawing.Size(70, 28);
|
||||
this.unitToolStripButton.Text = "Units";
|
||||
this.unitToolStripButton.Click += new System.EventHandler(this.mainToolStripButton_Click);
|
||||
//
|
||||
// buildingToolStripButton
|
||||
//
|
||||
this.buildingToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("buildingToolStripButton.Image")));
|
||||
this.buildingToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.buildingToolStripButton.Name = "buildingToolStripButton";
|
||||
this.buildingToolStripButton.Size = new System.Drawing.Size(102, 28);
|
||||
this.buildingToolStripButton.Text = "Structures";
|
||||
this.buildingToolStripButton.Click += new System.EventHandler(this.mainToolStripButton_Click);
|
||||
//
|
||||
// resourcesToolStripButton
|
||||
//
|
||||
this.resourcesToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("resourcesToolStripButton.Image")));
|
||||
this.resourcesToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.resourcesToolStripButton.Name = "resourcesToolStripButton";
|
||||
this.resourcesToolStripButton.Size = new System.Drawing.Size(103, 28);
|
||||
this.resourcesToolStripButton.Text = "Resources";
|
||||
this.resourcesToolStripButton.Click += new System.EventHandler(this.mainToolStripButton_Click);
|
||||
//
|
||||
// wallsToolStripButton
|
||||
//
|
||||
this.wallsToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("wallsToolStripButton.Image")));
|
||||
this.wallsToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.wallsToolStripButton.Name = "wallsToolStripButton";
|
||||
this.wallsToolStripButton.Size = new System.Drawing.Size(72, 28);
|
||||
this.wallsToolStripButton.Text = "Walls";
|
||||
this.wallsToolStripButton.Click += new System.EventHandler(this.mainToolStripButton_Click);
|
||||
//
|
||||
// waypointsToolStripButton
|
||||
//
|
||||
this.waypointsToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("waypointsToolStripButton.Image")));
|
||||
this.waypointsToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.waypointsToolStripButton.Name = "waypointsToolStripButton";
|
||||
this.waypointsToolStripButton.Size = new System.Drawing.Size(106, 28);
|
||||
this.waypointsToolStripButton.Text = "Waypoints";
|
||||
this.waypointsToolStripButton.Click += new System.EventHandler(this.mainToolStripButton_Click);
|
||||
//
|
||||
// cellTriggersToolStripButton
|
||||
//
|
||||
this.cellTriggersToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("cellTriggersToolStripButton.Image")));
|
||||
this.cellTriggersToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.cellTriggersToolStripButton.Name = "cellTriggersToolStripButton";
|
||||
this.cellTriggersToolStripButton.Size = new System.Drawing.Size(119, 28);
|
||||
this.cellTriggersToolStripButton.Text = "Cell Triggers";
|
||||
this.cellTriggersToolStripButton.Click += new System.EventHandler(this.mainToolStripButton_Click);
|
||||
//
|
||||
// mapPanel
|
||||
//
|
||||
this.mapPanel.BackColor = System.Drawing.Color.Black;
|
||||
this.mapPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.mapPanel.FocusOnMouseEnter = true;
|
||||
this.mapPanel.Location = new System.Drawing.Point(0, 59);
|
||||
this.mapPanel.MapImage = null;
|
||||
this.mapPanel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.mapPanel.MaxZoom = 8;
|
||||
this.mapPanel.MinZoom = 1;
|
||||
this.mapPanel.Name = "mapPanel";
|
||||
this.mapPanel.Quality = 2;
|
||||
this.mapPanel.Size = new System.Drawing.Size(1369, 592);
|
||||
this.mapPanel.TabIndex = 4;
|
||||
this.mapPanel.Zoom = 1;
|
||||
this.mapPanel.ZoomStep = 1;
|
||||
this.mapPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.mapPanel_MouseMove);
|
||||
//
|
||||
// copyrightStatusLabel
|
||||
//
|
||||
this.copyrightStatusLabel.Name = "copyrightStatusLabel";
|
||||
this.copyrightStatusLabel.Size = new System.Drawing.Size(1305, 20);
|
||||
this.copyrightStatusLabel.Spring = true;
|
||||
this.copyrightStatusLabel.Text = "©2020 Electronic Arts Inc.";
|
||||
this.copyrightStatusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1369, 676);
|
||||
this.Controls.Add(this.mapPanel);
|
||||
this.Controls.Add(this.mainToolStrip);
|
||||
this.Controls.Add(this.mainStatusStrip);
|
||||
this.Controls.Add(this.mainMenuStrip);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.KeyPreview = true;
|
||||
this.MainMenuStrip = this.mainMenuStrip;
|
||||
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.Name = "MainForm";
|
||||
this.Text = "CnC TDRA Map Editor";
|
||||
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
|
||||
this.mainMenuStrip.ResumeLayout(false);
|
||||
this.mainMenuStrip.PerformLayout();
|
||||
this.mainStatusStrip.ResumeLayout(false);
|
||||
this.mainStatusStrip.PerformLayout();
|
||||
this.mainToolStrip.ResumeLayout(false);
|
||||
this.mainToolStrip.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.MenuStrip mainMenuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileOpenMenuItem;
|
||||
private System.Windows.Forms.StatusStrip mainStatusStrip;
|
||||
private System.Windows.Forms.ToolStripStatusLabel cellStatusLabel;
|
||||
private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileSaveAsMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileExitMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileNewMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem developerToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem developerGenerateMapPreviewMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileExportMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem developerGenerateMapPreviewDirectoryMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem settingsMapSettingsMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem editUndoMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem editRedoMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
|
||||
private System.Windows.Forms.ToolStripMenuItem debugToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem developerDebugShowOverlapCellsMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem filePublishMenuItem;
|
||||
private System.Windows.Forms.ToolTip mouseToolTip;
|
||||
private System.Windows.Forms.ToolStrip mainToolStrip;
|
||||
private System.Windows.Forms.ToolStripButton mapToolStripButton;
|
||||
private System.Windows.Forms.ToolStripButton smudgeToolStripButton;
|
||||
private System.Windows.Forms.ToolStripButton overlayToolStripButton;
|
||||
private System.Windows.Forms.ToolStripButton terrainToolStripButton;
|
||||
private System.Windows.Forms.ToolStripButton infantryToolStripButton;
|
||||
private System.Windows.Forms.ToolStripButton unitToolStripButton;
|
||||
private System.Windows.Forms.ToolStripButton buildingToolStripButton;
|
||||
private System.Windows.Forms.ToolStripButton resourcesToolStripButton;
|
||||
private System.Windows.Forms.ToolStripButton wallsToolStripButton;
|
||||
private System.Windows.Forms.ToolStripButton waypointsToolStripButton;
|
||||
private Controls.MapPanel mapPanel;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileRecentFilesMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileSaveMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem4;
|
||||
private System.Windows.Forms.ToolStripMenuItem developerGoToINIMenuItem;
|
||||
private System.Windows.Forms.ToolStripButton cellTriggersToolStripButton;
|
||||
private System.Windows.Forms.ToolStripMenuItem settingsTeamTypesMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem settingsTriggersMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem layersToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem viewLayersBoundariesMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem viewLayersObjectTriggersMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem viewLayersCellTriggersMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem viewLayersWaypointsMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem viewLayersTerrainMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem viewLayersOverlayMenuItem;
|
||||
private System.Windows.Forms.ToolStripStatusLabel toolStatusLabel;
|
||||
private System.Windows.Forms.ToolStripStatusLabel copyrightStatusLabel;
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,185 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class BooleanTypeConverter : TypeConverter
|
||||
{
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
|
||||
{
|
||||
return (context is MapContext) && (sourceType == typeof(string));
|
||||
}
|
||||
|
||||
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
|
||||
{
|
||||
return (context is MapContext) && (destinationType == typeof(string));
|
||||
}
|
||||
|
||||
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (!(value is bool boolean) || !CanConvertTo(context, destinationType))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return boolean ? "1" : "0";
|
||||
}
|
||||
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
|
||||
{
|
||||
if (!(value is string str) || !CanConvertFrom(context, value?.GetType()))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var first = (str.Length > 0) ? str.ToUpper()[0] : 0;
|
||||
return (first == 'T') || (first == 'Y') || (first == '1');
|
||||
}
|
||||
}
|
||||
|
||||
public class PercentageTypeConverter : TypeConverter
|
||||
{
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
|
||||
{
|
||||
return (context is MapContext) && (sourceType == typeof(string));
|
||||
}
|
||||
|
||||
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
|
||||
{
|
||||
return (context is MapContext) && (destinationType == typeof(string));
|
||||
}
|
||||
|
||||
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (!(value is int percent) || !CanConvertTo(context, destinationType))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var mapContext = context as MapContext;
|
||||
return mapContext.FractionalPercentages ? (percent / 100M).ToString("D2") : percent.ToString();
|
||||
}
|
||||
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
|
||||
{
|
||||
if (!(value is string str) || !CanConvertFrom(context, value?.GetType()))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var mapContext = context as MapContext;
|
||||
if (mapContext.FractionalPercentages && str.Contains("."))
|
||||
{
|
||||
if (!decimal.TryParse(str, out decimal percent))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return (int)(percent * 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!int.TryParse(str, out int percent))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return percent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BasicSection : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
private string name;
|
||||
[DefaultValue(null)]
|
||||
public string Name { get => name; set => SetField(ref name, value); }
|
||||
|
||||
private int carryOverCap;
|
||||
[TypeConverter(typeof(PercentageTypeConverter))]
|
||||
[DefaultValue(-1)]
|
||||
public int CarryOverCap { get => carryOverCap; set => SetField(ref carryOverCap, value); }
|
||||
|
||||
private int carryOverMoney;
|
||||
[TypeConverter(typeof(PercentageTypeConverter))]
|
||||
[DefaultValue(100)]
|
||||
public int CarryOverMoney { get => carryOverMoney; set => SetField(ref carryOverMoney, value); }
|
||||
|
||||
private string intro;
|
||||
[DefaultValue(null)]
|
||||
public string Intro { get => intro; set => SetField(ref intro, value); }
|
||||
|
||||
private string theme;
|
||||
[DefaultValue("No Theme")]
|
||||
public string Theme { get => theme; set => SetField(ref theme, value); }
|
||||
|
||||
private int percent;
|
||||
[TypeConverter(typeof(PercentageTypeConverter))]
|
||||
[DefaultValue(100)]
|
||||
public int Percent { get => percent; set => SetField(ref percent, value); }
|
||||
|
||||
public string player;
|
||||
[DefaultValue(null)]
|
||||
public string Player { get => player; set => SetField(ref player, value); }
|
||||
|
||||
private string action;
|
||||
[DefaultValue("x")]
|
||||
public string Action { get => action; set => SetField(ref action, value); }
|
||||
|
||||
private string lose;
|
||||
[DefaultValue("x")]
|
||||
public string Lose { get => lose; set => SetField(ref lose, value); }
|
||||
|
||||
private string win;
|
||||
[DefaultValue("x")]
|
||||
public string Win { get => win; set => SetField(ref win, value); }
|
||||
|
||||
private string brief;
|
||||
[DefaultValue("x")]
|
||||
public string Brief { get => brief; set => SetField(ref brief, value); }
|
||||
|
||||
private string author;
|
||||
[DefaultValue(null)]
|
||||
public string Author { get => author; set => SetField(ref author, value); }
|
||||
|
||||
private string basePlayer;
|
||||
[NonSerializedINIKey]
|
||||
[DefaultValue(null)]
|
||||
public string BasePlayer { get => basePlayer; set => SetField(ref basePlayer, value); }
|
||||
|
||||
private bool soloMission;
|
||||
[DefaultValue(false)]
|
||||
public bool SoloMission { get => soloMission; set => SetField(ref soloMission, value); }
|
||||
|
||||
protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
|
||||
{
|
||||
if (EqualityComparer<T>.Default.Equals(field, value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
field = value;
|
||||
OnPropertyChanged(propertyName);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class BriefingSection
|
||||
{
|
||||
[DefaultValue(null)]
|
||||
public string Briefing { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class Building : ICellOverlapper, ICellOccupier, INotifyPropertyChanged, ICloneable
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
private BuildingType type;
|
||||
public BuildingType Type { get => type; set => SetField(ref type, value); }
|
||||
|
||||
public Rectangle OverlapBounds => Type.OverlapBounds;
|
||||
|
||||
public bool[,] OccupyMask => Type.OccupyMask;
|
||||
|
||||
private HouseType house;
|
||||
public HouseType House { get => house; set => SetField(ref house, value); }
|
||||
|
||||
private int strength;
|
||||
public int Strength { get => strength; set => SetField(ref strength, value); }
|
||||
|
||||
private DirectionType direction;
|
||||
public DirectionType Direction { get => direction; set => SetField(ref direction, value); }
|
||||
|
||||
private string trigger = Model.Trigger.None;
|
||||
public string Trigger { get => trigger; set => SetField(ref trigger, value); }
|
||||
|
||||
private int basePriority = -1;
|
||||
public int BasePriority { get => basePriority; set => SetField(ref basePriority, value); }
|
||||
|
||||
private bool isPrebuilt = true;
|
||||
public bool IsPrebuilt { get => isPrebuilt; set => SetField(ref isPrebuilt, value); }
|
||||
|
||||
private bool sellable;
|
||||
public bool Sellable { get => sellable; set => SetField(ref sellable, value); }
|
||||
|
||||
private bool rebuild;
|
||||
public bool Rebuild { get => rebuild; set => SetField(ref rebuild, value); }
|
||||
|
||||
public ISet<int> BibCells { get; private set; } = new HashSet<int>();
|
||||
|
||||
private Color tint = Color.White;
|
||||
public Color Tint
|
||||
{
|
||||
get => IsPrebuilt ? tint : Color.FromArgb((int)(tint.A * 0.75f), tint.R, tint.G, tint.B);
|
||||
set => tint = value;
|
||||
}
|
||||
|
||||
public Building Clone()
|
||||
{
|
||||
return new Building()
|
||||
{
|
||||
Type = Type,
|
||||
House = House,
|
||||
Strength = Strength,
|
||||
Direction = Direction,
|
||||
Trigger = Trigger,
|
||||
BasePriority = BasePriority,
|
||||
IsPrebuilt = IsPrebuilt,
|
||||
Sellable = Sellable,
|
||||
Rebuild = Rebuild,
|
||||
Tint = Tint
|
||||
};
|
||||
}
|
||||
|
||||
protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
|
||||
{
|
||||
if (EqualityComparer<T>.Default.Equals(field, value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
field = value;
|
||||
OnPropertyChanged(propertyName);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
|
||||
object ICloneable.Clone()
|
||||
{
|
||||
return Clone();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,166 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Render;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class BuildingType : ICellOverlapper, ICellOccupier, ITechnoType, IBrowsableType
|
||||
{
|
||||
public sbyte ID { get; private set; }
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
public string DisplayName { get; private set; }
|
||||
|
||||
public string Tilename { get; private set; }
|
||||
|
||||
public Rectangle OverlapBounds => new Rectangle(Point.Empty, new Size(OccupyMask.GetLength(1), OccupyMask.GetLength(0)));
|
||||
|
||||
public bool[,] OccupyMask { get; private set; }
|
||||
|
||||
public bool[,] BaseOccupyMask { get; private set; }
|
||||
|
||||
public Size Size { get; private set; }
|
||||
|
||||
public bool HasBib { get; private set; }
|
||||
|
||||
public string OwnerHouse { get; private set; }
|
||||
|
||||
public TheaterType[] Theaters { get; private set; }
|
||||
|
||||
public bool IsFake { get; private set; }
|
||||
|
||||
public bool HasTurret { get; private set; }
|
||||
|
||||
public string FactoryOverlay { get; private set; }
|
||||
|
||||
public Image Thumbnail { get; set; }
|
||||
|
||||
public BuildingType(sbyte id, string name, string textId, bool[,] occupyMask, bool hasBib, string ownerHouse, TheaterType[] theaters, bool isFake, bool hasTurret, string factoryOverlay)
|
||||
{
|
||||
ID = id;
|
||||
Name = isFake ? (name.Substring(0, name.Length - 1) + "f") : name;
|
||||
DisplayName = Globals.TheGameTextManager[textId];
|
||||
Tilename = name;
|
||||
BaseOccupyMask = occupyMask;
|
||||
Size = new Size(BaseOccupyMask.GetLength(1), BaseOccupyMask.GetLength(0));
|
||||
HasBib = hasBib;
|
||||
OwnerHouse = ownerHouse;
|
||||
Theaters = theaters;
|
||||
IsFake = isFake;
|
||||
HasTurret = hasTurret;
|
||||
FactoryOverlay = factoryOverlay;
|
||||
|
||||
if (HasBib)
|
||||
{
|
||||
OccupyMask = new bool[BaseOccupyMask.GetLength(0) + 1, BaseOccupyMask.GetLength(1)];
|
||||
for (var i = 0; i < BaseOccupyMask.GetLength(0) - 1; ++i)
|
||||
{
|
||||
for (var j = 0; j < BaseOccupyMask.GetLength(1); ++j)
|
||||
{
|
||||
OccupyMask[i, j] = BaseOccupyMask[i, j];
|
||||
}
|
||||
}
|
||||
for (var j = 0; j < OccupyMask.GetLength(1); ++j)
|
||||
{
|
||||
OccupyMask[OccupyMask.GetLength(0) - 2, j] = true;
|
||||
OccupyMask[OccupyMask.GetLength(0) - 1, j] = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
OccupyMask = BaseOccupyMask;
|
||||
}
|
||||
}
|
||||
|
||||
public BuildingType(sbyte id, string name, string textId, bool[,] occupyMask, bool hasBib, string ownerHouse, bool isFake, bool hasTurret, string factoryOverlay)
|
||||
: this(id, name, textId, occupyMask, hasBib, ownerHouse, null, isFake, hasTurret, factoryOverlay)
|
||||
{
|
||||
}
|
||||
|
||||
public BuildingType(sbyte id, string name, string textId, bool[,] occupyMask, bool hasBib, string ownerHouse)
|
||||
: this(id, name, textId, occupyMask, hasBib, ownerHouse, null, false, false, null)
|
||||
{
|
||||
}
|
||||
|
||||
public BuildingType(sbyte id, string name, string textId, bool[,] occupyMask, bool hasBib, string ownerHouse, TheaterType[] theaters)
|
||||
: this(id, name, textId, occupyMask, hasBib, ownerHouse, theaters, false, false, null)
|
||||
{
|
||||
}
|
||||
|
||||
public BuildingType(sbyte id, string name, string textId, bool[,] occupyMask, bool hasBib, string ownerHouse, bool isFake)
|
||||
: this(id, name, textId, occupyMask, hasBib, ownerHouse, null, isFake, false, null)
|
||||
{
|
||||
}
|
||||
|
||||
public BuildingType(sbyte id, string name, string textId, bool[,] occupyMask, bool hasBib, string ownerHouse, bool isFake, bool hasTurret)
|
||||
: this(id, name, textId, occupyMask, hasBib, ownerHouse, null, isFake, hasTurret, null)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is BuildingType)
|
||||
{
|
||||
return this == obj;
|
||||
}
|
||||
else if (obj is sbyte)
|
||||
{
|
||||
return ID == (sbyte)obj;
|
||||
}
|
||||
else if (obj is string)
|
||||
{
|
||||
return string.Equals(Name, obj as string, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ID.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
public void Init(GameType gameType, TheaterType theater, HouseType house, DirectionType direction)
|
||||
{
|
||||
var mockBuilding = new Building()
|
||||
{
|
||||
Type = this,
|
||||
House = house,
|
||||
Strength = 256,
|
||||
Direction = direction
|
||||
};
|
||||
|
||||
var render = MapRenderer.Render(gameType, theater, Point.Empty, Globals.TileSize, Globals.TileScale, mockBuilding);
|
||||
if (!render.Item1.IsEmpty)
|
||||
{
|
||||
var buildingPreview = new Bitmap(render.Item1.Width, render.Item1.Height);
|
||||
using (var g = Graphics.FromImage(buildingPreview))
|
||||
{
|
||||
render.Item2(g);
|
||||
}
|
||||
Thumbnail = buildingPreview;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,193 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public enum FacingType
|
||||
{
|
||||
None,
|
||||
North,
|
||||
NorthEast,
|
||||
East,
|
||||
SouthEast,
|
||||
South,
|
||||
SouthWest,
|
||||
West,
|
||||
NorthWest
|
||||
}
|
||||
|
||||
public class CellChangedEventArgs<T> : EventArgs
|
||||
{
|
||||
public readonly int Cell;
|
||||
|
||||
public readonly Point Location;
|
||||
|
||||
public readonly T OldValue;
|
||||
|
||||
public readonly T Value;
|
||||
|
||||
public CellChangedEventArgs(CellMetrics metrics, int cell, T oldValue, T value)
|
||||
{
|
||||
Cell = cell;
|
||||
metrics.GetLocation(cell, out Location);
|
||||
OldValue = oldValue;
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public CellChangedEventArgs(CellMetrics metrics, Point location, T oldValue, T value)
|
||||
{
|
||||
Location = location;
|
||||
metrics.GetCell(location, out Cell);
|
||||
OldValue = oldValue;
|
||||
Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
public class CellGrid<T> : IEnumerable<(int Cell, T Value)>, IEnumerable
|
||||
{
|
||||
private readonly CellMetrics metrics;
|
||||
private readonly T[,] cells;
|
||||
|
||||
public T this[int x, int y]
|
||||
{
|
||||
get => cells[y, x];
|
||||
set
|
||||
{
|
||||
if (!EqualityComparer<T>.Default.Equals(cells[y, x], value))
|
||||
{
|
||||
var lastValue = cells[y, x];
|
||||
cells[y, x] = value;
|
||||
OnCellChanged(new CellChangedEventArgs<T>(metrics, new Point(x, y), lastValue, cells[y, x]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public T this[Point location] { get => this[location.X, location.Y]; set => this[location.X, location.Y] = value; }
|
||||
|
||||
public T this[int cell] { get => this[cell % metrics.Width, cell / metrics.Width]; set => this[cell % metrics.Width, cell / metrics.Width] = value; }
|
||||
|
||||
public Size Size => metrics.Size;
|
||||
|
||||
public int Length => metrics.Length;
|
||||
|
||||
public event EventHandler<CellChangedEventArgs<T>> CellChanged;
|
||||
public event EventHandler<EventArgs> Cleared;
|
||||
|
||||
public CellGrid(CellMetrics metrics)
|
||||
{
|
||||
this.metrics = metrics;
|
||||
|
||||
cells = new T[metrics.Height, metrics.Width];
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
Array.Clear(cells, 0, cells.Length);
|
||||
OnCleared();
|
||||
}
|
||||
|
||||
public T Adjacent(Point location, FacingType facing)
|
||||
{
|
||||
return metrics.Adjacent(location, facing, out Point adjacent) ? this[adjacent] : default;
|
||||
}
|
||||
|
||||
public T Adjacent(int cell, FacingType facing)
|
||||
{
|
||||
if (!metrics.GetLocation(cell, out Point location))
|
||||
{
|
||||
return default;
|
||||
|
||||
}
|
||||
return metrics.Adjacent(location, facing, out Point adjacent) ? this[adjacent] : default;
|
||||
}
|
||||
|
||||
public bool CopyTo(CellGrid<T> other)
|
||||
{
|
||||
if (metrics.Length != other.metrics.Length)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i = 0; i < metrics.Length; ++i)
|
||||
{
|
||||
other[i] = this[i];
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected virtual void OnCellChanged(CellChangedEventArgs<T> e)
|
||||
{
|
||||
CellChanged?.Invoke(this, e);
|
||||
}
|
||||
|
||||
protected virtual void OnCleared()
|
||||
{
|
||||
Cleared?.Invoke(this, new EventArgs());
|
||||
}
|
||||
|
||||
public IEnumerable<(int Cell, T Value)> IntersectsWith(ISet<int> cells)
|
||||
{
|
||||
foreach (var i in cells)
|
||||
{
|
||||
if (metrics.Contains(i))
|
||||
{
|
||||
var cell = this[i];
|
||||
if (cell != null)
|
||||
{
|
||||
yield return (i, cell);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<(int Cell, T Value)> IntersectsWith(ISet<Point> locations)
|
||||
{
|
||||
foreach (var location in locations)
|
||||
{
|
||||
if (metrics.Contains(location))
|
||||
{
|
||||
var cell = this[location];
|
||||
if (cell != null)
|
||||
{
|
||||
metrics.GetCell(location, out int i);
|
||||
yield return (i, cell);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator<(int Cell, T Value)> GetEnumerator()
|
||||
{
|
||||
for (var i = 0; i < metrics.Length; ++i)
|
||||
{
|
||||
var cell = this[i];
|
||||
if (cell != null)
|
||||
{
|
||||
yield return (i, cell);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,137 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class CellMetrics
|
||||
{
|
||||
public static readonly FacingType[] AdjacentFacings = new FacingType[] {
|
||||
FacingType.North, FacingType.NorthEast, FacingType.East, FacingType.SouthEast, FacingType.South, FacingType.SouthWest, FacingType.West, FacingType.NorthWest
|
||||
};
|
||||
|
||||
public int Width { get; private set; }
|
||||
|
||||
public int Height { get; private set; }
|
||||
|
||||
public Point TopLeft => Point.Empty;
|
||||
|
||||
public Size Size => new Size(Width, Height);
|
||||
|
||||
public Rectangle Bounds => new Rectangle(TopLeft, Size);
|
||||
|
||||
public int Length => Width * Height;
|
||||
|
||||
public bool Contains(Point location) => ((location.X >= 0) && (location.X < Width) && (location.Y >= 0) && (location.Y < Height));
|
||||
|
||||
public bool Contains(int cell) => ((cell >= 0) && (cell < Length));
|
||||
|
||||
public CellMetrics(int width, int height)
|
||||
{
|
||||
Width = width;
|
||||
Height = height;
|
||||
}
|
||||
|
||||
public CellMetrics(Size size)
|
||||
: this(size.Width, size.Height)
|
||||
{
|
||||
}
|
||||
|
||||
public bool GetCell(Point location, out int cell)
|
||||
{
|
||||
cell = (location.Y * Width) + location.X;
|
||||
return Contains(location);
|
||||
}
|
||||
|
||||
public bool GetLocation(int cell, out Point location)
|
||||
{
|
||||
location = new Point(cell % Width, cell / Width);
|
||||
return Contains(cell);
|
||||
}
|
||||
|
||||
public bool Adjacent(Point location, FacingType facing, out Point adjacent)
|
||||
{
|
||||
adjacent = location;
|
||||
switch (facing)
|
||||
{
|
||||
case FacingType.North:
|
||||
adjacent.Y--;
|
||||
break;
|
||||
case FacingType.NorthEast:
|
||||
adjacent.X++;
|
||||
adjacent.Y--;
|
||||
break;
|
||||
case FacingType.East:
|
||||
adjacent.X++;
|
||||
break;
|
||||
case FacingType.SouthEast:
|
||||
adjacent.X++;
|
||||
adjacent.Y++;
|
||||
break;
|
||||
case FacingType.South:
|
||||
adjacent.Y++;
|
||||
break;
|
||||
case FacingType.SouthWest:
|
||||
adjacent.X--;
|
||||
adjacent.Y++;
|
||||
break;
|
||||
case FacingType.West:
|
||||
adjacent.X--;
|
||||
break;
|
||||
case FacingType.NorthWest:
|
||||
adjacent.X--;
|
||||
adjacent.Y--;
|
||||
break;
|
||||
}
|
||||
|
||||
return Contains(adjacent);
|
||||
}
|
||||
|
||||
public bool Adjacent(int cell, FacingType facing, out int adjacent)
|
||||
{
|
||||
if (!GetLocation(cell, out Point location) || !Adjacent(location, facing, out Point adjacentPoint))
|
||||
{
|
||||
adjacent = -1;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetCell(adjacentPoint, out adjacent);
|
||||
}
|
||||
}
|
||||
|
||||
public void Clip(ref Point location)
|
||||
{
|
||||
location.X = Math.Max(0, Math.Min(Width - 1, location.X));
|
||||
location.Y = Math.Max(0, Math.Min(Height - 1, location.Y));
|
||||
}
|
||||
|
||||
public void Clip(ref Point location, Size margin)
|
||||
{
|
||||
Clip(ref location, margin, margin);
|
||||
}
|
||||
|
||||
public void Clip(ref Point location, Size topLeftMargin, Size bottomRightMargin)
|
||||
{
|
||||
location.X = Math.Max(topLeftMargin.Width, Math.Min(Width - bottomRightMargin.Width - 1, location.X));
|
||||
location.Y = Math.Max(topLeftMargin.Height, Math.Min(Height - bottomRightMargin.Height - 1, location.Y));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class CellTrigger
|
||||
{
|
||||
public string Trigger { get; set; } = Model.Trigger.None;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class DirectionType
|
||||
{
|
||||
public byte ID { get; private set; }
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
public FacingType Facing { get; private set; }
|
||||
|
||||
public DirectionType(byte id, string name, FacingType facing)
|
||||
{
|
||||
ID = id;
|
||||
Name = name;
|
||||
Facing = facing;
|
||||
}
|
||||
|
||||
public DirectionType(byte id, string name)
|
||||
: this(id, name, FacingType.None)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is DirectionType)
|
||||
{
|
||||
return this == obj;
|
||||
}
|
||||
else if (obj is byte)
|
||||
{
|
||||
return ID == (byte)obj;
|
||||
}
|
||||
else if (obj is string)
|
||||
{
|
||||
return string.Equals(Name, obj as string, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
else if (obj is FacingType)
|
||||
{
|
||||
return Facing == (FacingType)obj;
|
||||
}
|
||||
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ID.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,172 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public struct AlliesMask : IEnumerable<int>
|
||||
{
|
||||
public int Value { get; private set; }
|
||||
|
||||
public AlliesMask(int value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public void Set(int id)
|
||||
{
|
||||
if ((id < 0) || (id > 31))
|
||||
{
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
Value |= (1 << id);
|
||||
}
|
||||
|
||||
public void Clear(int id)
|
||||
{
|
||||
if ((id < 0) || (id > 31))
|
||||
{
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
Value &= ~(1 << id);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return Value.Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Value.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Value.ToString();
|
||||
}
|
||||
|
||||
public IEnumerator<int> GetEnumerator()
|
||||
{
|
||||
for (int i = 0, mask = 1; i < 32; ++i, mask <<= 1)
|
||||
{
|
||||
if ((Value & mask) != 0)
|
||||
{
|
||||
yield return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
|
||||
public class AlliesMaskTypeConverter : TypeConverter
|
||||
{
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
|
||||
{
|
||||
return (context is MapContext) && (sourceType == typeof(string));
|
||||
}
|
||||
|
||||
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
|
||||
{
|
||||
return (context is MapContext) && (destinationType == typeof(string));
|
||||
}
|
||||
|
||||
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (!(value is AlliesMask) || !CanConvertTo(context, destinationType))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var map = (context as MapContext).Map;
|
||||
var alliesMask = (AlliesMask)value;
|
||||
|
||||
var allies = new List<string>(map.Houses.Length);
|
||||
foreach (var id in alliesMask)
|
||||
{
|
||||
if (map.Houses.Where(h => h.Type.Equals((sbyte)id)).FirstOrDefault() is House house)
|
||||
{
|
||||
allies.Add(house.Type.Name);
|
||||
}
|
||||
}
|
||||
|
||||
return string.Join(",", allies);
|
||||
}
|
||||
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
|
||||
{
|
||||
if (!CanConvertFrom(context, value?.GetType()))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var map = (context as MapContext).Instance as Map;
|
||||
var alliesMask = new AlliesMask(0);
|
||||
|
||||
var allies = (value as string).Split(',');
|
||||
foreach (var ally in allies)
|
||||
{
|
||||
if (map.Houses.Where(h => h.Type.Equals(ally)).FirstOrDefault() is House house)
|
||||
{
|
||||
alliesMask.Set(house.Type.ID);
|
||||
}
|
||||
}
|
||||
|
||||
return alliesMask;
|
||||
}
|
||||
}
|
||||
|
||||
public class House
|
||||
{
|
||||
public readonly HouseType Type;
|
||||
|
||||
[NonSerializedINIKey]
|
||||
[DefaultValue(true)]
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
[TypeConverter(typeof(AlliesMaskTypeConverter))]
|
||||
public AlliesMask Allies { get; set; }
|
||||
|
||||
[DefaultValue(150)]
|
||||
public int MaxBuilding { get; set; }
|
||||
|
||||
[DefaultValue(150)]
|
||||
public int MaxUnit { get; set; }
|
||||
|
||||
[DefaultValue("North")]
|
||||
public string Edge { get; set; }
|
||||
|
||||
[DefaultValue(0)]
|
||||
public int Credits { get; set; } = 0;
|
||||
|
||||
public House(HouseType type)
|
||||
{
|
||||
Type = type;
|
||||
Allies = new AlliesMask(1 << Type.ID);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class HouseType
|
||||
{
|
||||
public sbyte ID { get; private set; }
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
public string UnitTeamColor { get; private set; }
|
||||
|
||||
public string BuildingTeamColor { get; private set; }
|
||||
|
||||
public IDictionary<string, string> OverrideTeamColors { get; private set; }
|
||||
|
||||
public HouseType(sbyte id, string name, string unitTeamColor, string buildingTeamColor, params (string type, string teamColor)[] overrideTeamColors)
|
||||
{
|
||||
ID = id;
|
||||
Name = name;
|
||||
UnitTeamColor = unitTeamColor;
|
||||
BuildingTeamColor = buildingTeamColor;
|
||||
OverrideTeamColors = overrideTeamColors.ToDictionary(x => x.type, x => x.teamColor);
|
||||
}
|
||||
|
||||
public HouseType(sbyte id, string name, string teamColor)
|
||||
: this(id, name, teamColor, teamColor)
|
||||
{
|
||||
}
|
||||
|
||||
public HouseType(sbyte id, string name)
|
||||
: this(id, name, null)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is HouseType)
|
||||
{
|
||||
return this == obj;
|
||||
}
|
||||
else if (obj is sbyte)
|
||||
{
|
||||
return ID == (sbyte)obj;
|
||||
}
|
||||
else if (obj is string)
|
||||
{
|
||||
return string.Equals(Name, obj as string, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ID.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,127 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public enum InfantryStoppingType
|
||||
{
|
||||
Center = 0,
|
||||
UpperLeft = 1,
|
||||
UpperRight = 2,
|
||||
LowerLeft = 3,
|
||||
LowerRight = 4
|
||||
}
|
||||
|
||||
public class Infantry : INotifyPropertyChanged, ICloneable
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public InfantryGroup InfantryGroup { get; set; }
|
||||
|
||||
private InfantryType type;
|
||||
public InfantryType Type { get => type; set => SetField(ref type, value); }
|
||||
|
||||
private HouseType house;
|
||||
public HouseType House { get => house; set => SetField(ref house, value); }
|
||||
|
||||
private int strength;
|
||||
public int Strength { get => strength; set => SetField(ref strength, value); }
|
||||
|
||||
private DirectionType direction;
|
||||
public DirectionType Direction { get => direction; set => SetField(ref direction, value); }
|
||||
|
||||
private string mission;
|
||||
public string Mission { get => mission; set => SetField(ref mission, value); }
|
||||
|
||||
private string trigger = Model.Trigger.None;
|
||||
public string Trigger { get => trigger; set => SetField(ref trigger, value); }
|
||||
|
||||
public Color Tint { get; set; } = Color.White;
|
||||
|
||||
public Infantry(InfantryGroup infantryGroup)
|
||||
{
|
||||
InfantryGroup = infantryGroup;
|
||||
}
|
||||
|
||||
public Infantry Clone()
|
||||
{
|
||||
return new Infantry(InfantryGroup)
|
||||
{
|
||||
Type = Type,
|
||||
House = House,
|
||||
Strength = Strength,
|
||||
Direction = Direction,
|
||||
Trigger = Trigger,
|
||||
Mission = Mission,
|
||||
};
|
||||
}
|
||||
|
||||
protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
|
||||
{
|
||||
if (EqualityComparer<T>.Default.Equals(field, value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
field = value;
|
||||
OnPropertyChanged(propertyName);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
|
||||
object ICloneable.Clone()
|
||||
{
|
||||
return Clone();
|
||||
}
|
||||
}
|
||||
|
||||
public class InfantryGroup : ICellOverlapper, ICellOccupier
|
||||
{
|
||||
private static readonly Point[] stoppingLocations = new Point[Globals.NumInfantryStops];
|
||||
|
||||
public Rectangle OverlapBounds => new Rectangle(-1, -1, 3, 3);
|
||||
|
||||
public bool[,] OccupyMask => new bool[1, 1] { { true } };
|
||||
|
||||
public readonly Infantry[] Infantry = new Infantry[Globals.NumInfantryStops];
|
||||
|
||||
static InfantryGroup()
|
||||
{
|
||||
stoppingLocations[(int)InfantryStoppingType.Center] = new Point(Globals.PixelWidth / 2, Globals.PixelHeight / 2);
|
||||
stoppingLocations[(int)InfantryStoppingType.UpperLeft] = new Point(Globals.PixelWidth / 4, Globals.PixelHeight / 4);
|
||||
stoppingLocations[(int)InfantryStoppingType.UpperRight] = new Point(3 * Globals.PixelWidth / 4, Globals.PixelHeight / 4);
|
||||
stoppingLocations[(int)InfantryStoppingType.LowerLeft] = new Point(Globals.PixelWidth / 4, 3 * Globals.PixelHeight / 4);
|
||||
stoppingLocations[(int)InfantryStoppingType.LowerRight] = new Point(3 * Globals.PixelWidth / 4, 3 * Globals.PixelHeight / 4);
|
||||
}
|
||||
|
||||
public static IEnumerable<InfantryStoppingType> ClosestStoppingTypes(Point subPixel)
|
||||
{
|
||||
var stoppingDistances = new (InfantryStoppingType type, float dist)[stoppingLocations.Length];
|
||||
for (int i = 0; i < stoppingDistances.Length; ++i)
|
||||
{
|
||||
stoppingDistances[i] = ((InfantryStoppingType)i, new Vector2(subPixel.X - stoppingLocations[i].X, subPixel.Y - stoppingLocations[i].Y).LengthSquared());
|
||||
}
|
||||
return stoppingDistances.OrderBy(sd => sd.dist).Select(sd => sd.type);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Render;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class InfantryType : ITechnoType, IBrowsableType
|
||||
{
|
||||
public sbyte ID { get; private set; }
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
public string DisplayName { get; private set; }
|
||||
|
||||
public string OwnerHouse { get; private set; }
|
||||
|
||||
public Size RenderSize { get; set; }
|
||||
|
||||
public Image Thumbnail { get; set; }
|
||||
|
||||
public InfantryType(sbyte id, string name, string textId, string ownerHouse)
|
||||
{
|
||||
ID = id;
|
||||
Name = name;
|
||||
DisplayName = Globals.TheGameTextManager[textId];
|
||||
OwnerHouse = ownerHouse;
|
||||
}
|
||||
|
||||
public InfantryType(sbyte id, string name, string textId)
|
||||
: this(id, name, textId, null)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is InfantryType)
|
||||
{
|
||||
return this == obj;
|
||||
}
|
||||
else if (obj is sbyte)
|
||||
{
|
||||
return ID == (sbyte)obj;
|
||||
}
|
||||
else if (obj is string)
|
||||
{
|
||||
return string.Equals(Name, obj as string, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ID.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
public void Init(GameType gameType, TheaterType theater, HouseType house, DirectionType direction)
|
||||
{
|
||||
if (Globals.TheTilesetManager.GetTileData(theater.Tilesets, Name, 4, out Tile tile))
|
||||
{
|
||||
RenderSize = new Size(tile.Image.Width / Globals.TileScale, tile.Image.Height / Globals.TileScale);
|
||||
}
|
||||
|
||||
var mockInfantry = new Infantry(null)
|
||||
{
|
||||
Type = this,
|
||||
House = house,
|
||||
Strength = 256,
|
||||
Direction = direction
|
||||
};
|
||||
var infantryThumbnail = new Bitmap(Globals.TileWidth, Globals.TileHeight);
|
||||
using (var g = Graphics.FromImage(infantryThumbnail))
|
||||
{
|
||||
MapRenderer.Render(theater, Point.Empty, Globals.TileSize, mockInfantry, InfantryStoppingType.Center).Item2(g);
|
||||
}
|
||||
Thumbnail = infantryThumbnail;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,681 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Render;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using TGASharpLib;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
[Flags]
|
||||
public enum MapLayerFlag
|
||||
{
|
||||
None = 0,
|
||||
Basic = 1 << 0,
|
||||
Map = 1 << 1,
|
||||
Template = 1 << 2,
|
||||
Terrain = 1 << 3,
|
||||
Resources = 1 << 4,
|
||||
Walls = 1 << 5,
|
||||
Overlay = 1 << 6,
|
||||
Smudge = 1 << 7,
|
||||
Waypoints = 1 << 8,
|
||||
CellTriggers = 1 << 9,
|
||||
Houses = 1 << 10,
|
||||
Infantry = 1 << 11,
|
||||
Units = 1 << 12,
|
||||
Buildings = 1 << 13,
|
||||
Boundaries = 1 << 14,
|
||||
TechnoTriggers = 1 << 15,
|
||||
|
||||
OverlayAll = Resources | Walls | Overlay,
|
||||
Technos = Terrain | Walls | Infantry | Units | Buildings,
|
||||
|
||||
All = int.MaxValue
|
||||
}
|
||||
|
||||
public class MapContext : ITypeDescriptorContext
|
||||
{
|
||||
public IContainer Container { get; private set; }
|
||||
|
||||
public object Instance { get; private set; }
|
||||
|
||||
public PropertyDescriptor PropertyDescriptor { get; private set; }
|
||||
|
||||
public Map Map => Instance as Map;
|
||||
|
||||
public readonly bool FractionalPercentages;
|
||||
|
||||
public MapContext(Map map, bool fractionalPercentages)
|
||||
{
|
||||
Instance = map;
|
||||
FractionalPercentages = fractionalPercentages;
|
||||
}
|
||||
|
||||
public object GetService(Type serviceType) => null;
|
||||
|
||||
public void OnComponentChanged() { }
|
||||
|
||||
public bool OnComponentChanging() => true;
|
||||
}
|
||||
|
||||
public class Map : ICloneable
|
||||
{
|
||||
private int updateCount = 0;
|
||||
private bool updating = false;
|
||||
private IDictionary<MapLayerFlag, ISet<Point>> invalidateLayers = new Dictionary<MapLayerFlag, ISet<Point>>();
|
||||
private bool invalidateOverlappers;
|
||||
|
||||
public readonly BasicSection BasicSection;
|
||||
|
||||
public readonly MapSection MapSection = new MapSection();
|
||||
|
||||
public readonly BriefingSection BriefingSection = new BriefingSection();
|
||||
|
||||
public readonly SteamSection SteamSection = new SteamSection();
|
||||
|
||||
public TheaterType Theater { get => MapSection.Theater; set => MapSection.Theater = value; }
|
||||
|
||||
public Point TopLeft
|
||||
{
|
||||
get => new Point(MapSection.X, MapSection.Y);
|
||||
set { MapSection.X = value.X; MapSection.Y = value.Y; }
|
||||
}
|
||||
|
||||
public Size Size
|
||||
{
|
||||
get => new Size(MapSection.Width, MapSection.Height);
|
||||
set { MapSection.Width = value.Width; MapSection.Height = value.Height; }
|
||||
}
|
||||
|
||||
public Rectangle Bounds
|
||||
{
|
||||
get => new Rectangle(TopLeft, Size);
|
||||
set { MapSection.X = value.Left; MapSection.Y = value.Top; MapSection.Width = value.Width; MapSection.Height = value.Height; }
|
||||
}
|
||||
|
||||
public readonly Type HouseType;
|
||||
|
||||
public readonly HouseType[] HouseTypes;
|
||||
|
||||
public readonly List<TheaterType> TheaterTypes;
|
||||
|
||||
public readonly List<TemplateType> TemplateTypes;
|
||||
|
||||
public readonly List<TerrainType> TerrainTypes;
|
||||
|
||||
public readonly List<OverlayType> OverlayTypes;
|
||||
|
||||
public readonly List<SmudgeType> SmudgeTypes;
|
||||
|
||||
public readonly string[] EventTypes;
|
||||
|
||||
public readonly string[] ActionTypes;
|
||||
|
||||
public readonly string[] MissionTypes;
|
||||
|
||||
public readonly List<DirectionType> DirectionTypes;
|
||||
|
||||
public readonly List<InfantryType> InfantryTypes;
|
||||
|
||||
public readonly List<UnitType> UnitTypes;
|
||||
|
||||
public readonly List<BuildingType> BuildingTypes;
|
||||
|
||||
public readonly string[] TeamMissionTypes;
|
||||
|
||||
public readonly CellMetrics Metrics;
|
||||
|
||||
public readonly CellGrid<Template> Templates;
|
||||
|
||||
public readonly CellGrid<Overlay> Overlay;
|
||||
|
||||
public readonly CellGrid<Smudge> Smudge;
|
||||
|
||||
public readonly OccupierSet<ICellOccupier> Technos;
|
||||
|
||||
public readonly OccupierSet<ICellOccupier> Buildings;
|
||||
|
||||
public readonly OverlapperSet<ICellOverlapper> Overlappers;
|
||||
|
||||
public readonly Waypoint[] Waypoints;
|
||||
|
||||
public readonly CellGrid<CellTrigger> CellTriggers;
|
||||
|
||||
public readonly ObservableCollection<Trigger> Triggers;
|
||||
|
||||
public readonly List<TeamType> TeamTypes;
|
||||
|
||||
public House[] Houses;
|
||||
|
||||
public readonly List<string> MovieTypes;
|
||||
|
||||
public int TiberiumOrGoldValue { get; set; }
|
||||
|
||||
public int GemValue { get; set; }
|
||||
|
||||
public int TotalResources
|
||||
{
|
||||
get
|
||||
{
|
||||
int totalResources = 0;
|
||||
foreach (var (cell, value) in Overlay)
|
||||
{
|
||||
if (value.Type.IsResource)
|
||||
{
|
||||
totalResources += (value.Icon + 1) * (value.Type.IsGem ? GemValue : TiberiumOrGoldValue);
|
||||
}
|
||||
}
|
||||
return totalResources;
|
||||
}
|
||||
}
|
||||
|
||||
public Map(BasicSection basicSection, TheaterType theater, Size cellSize, Type houseType,
|
||||
IEnumerable<HouseType> houseTypes, IEnumerable<TheaterType> theaterTypes, IEnumerable<TemplateType> templateTypes,
|
||||
IEnumerable<TerrainType> terrainTypes, IEnumerable<OverlayType> overlayTypes, IEnumerable<SmudgeType> smudgeTypes,
|
||||
IEnumerable<string> eventTypes, IEnumerable<string> actionTypes, IEnumerable<string> missionTypes,
|
||||
IEnumerable<DirectionType> directionTypes, IEnumerable<InfantryType> infantryTypes, IEnumerable<UnitType> unitTypes,
|
||||
IEnumerable<BuildingType> buildingTypes, IEnumerable<string> teamMissionTypes, IEnumerable<Waypoint> waypoints,
|
||||
IEnumerable<string> movieTypes)
|
||||
{
|
||||
BasicSection = basicSection;
|
||||
|
||||
HouseType = houseType;
|
||||
HouseTypes = houseTypes.ToArray();
|
||||
TheaterTypes = new List<TheaterType>(theaterTypes);
|
||||
TemplateTypes = new List<TemplateType>(templateTypes);
|
||||
TerrainTypes = new List<TerrainType>(terrainTypes);
|
||||
OverlayTypes = new List<OverlayType>(overlayTypes);
|
||||
SmudgeTypes = new List<SmudgeType>(smudgeTypes);
|
||||
EventTypes = eventTypes.ToArray();
|
||||
ActionTypes = actionTypes.ToArray();
|
||||
MissionTypes = missionTypes.ToArray();
|
||||
DirectionTypes = new List<DirectionType>(directionTypes);
|
||||
InfantryTypes = new List<InfantryType>(infantryTypes);
|
||||
UnitTypes = new List<UnitType>(unitTypes);
|
||||
BuildingTypes = new List<BuildingType>(buildingTypes);
|
||||
TeamMissionTypes = teamMissionTypes.ToArray();
|
||||
MovieTypes = new List<string>(movieTypes);
|
||||
|
||||
Metrics = new CellMetrics(cellSize);
|
||||
Templates = new CellGrid<Template>(Metrics);
|
||||
Overlay = new CellGrid<Overlay>(Metrics);
|
||||
Smudge = new CellGrid<Smudge>(Metrics);
|
||||
Technos = new OccupierSet<ICellOccupier>(Metrics);
|
||||
Buildings = new OccupierSet<ICellOccupier>(Metrics);
|
||||
Overlappers = new OverlapperSet<ICellOverlapper>(Metrics);
|
||||
Triggers = new ObservableCollection<Trigger>();
|
||||
TeamTypes = new List<TeamType>();
|
||||
Houses = HouseTypes.Select(t => { var h = (House)Activator.CreateInstance(HouseType, t); h.SetDefault(); return h; }).ToArray();
|
||||
Waypoints = waypoints.ToArray();
|
||||
CellTriggers = new CellGrid<CellTrigger>(Metrics);
|
||||
|
||||
MapSection.SetDefault();
|
||||
BriefingSection.SetDefault();
|
||||
SteamSection.SetDefault();
|
||||
Templates.Clear();
|
||||
Overlay.Clear();
|
||||
Smudge.Clear();
|
||||
Technos.Clear();
|
||||
Overlappers.Clear();
|
||||
CellTriggers.Clear();
|
||||
|
||||
TopLeft = new Point(1, 1);
|
||||
Size = Metrics.Size - new Size(2, 2);
|
||||
Theater = theater;
|
||||
|
||||
Overlay.CellChanged += Overlay_CellChanged;
|
||||
Technos.OccupierAdded += Technos_OccupierAdded;
|
||||
Technos.OccupierRemoved += Technos_OccupierRemoved;
|
||||
Buildings.OccupierAdded += Buildings_OccupierAdded;
|
||||
Buildings.OccupierRemoved += Buildings_OccupierRemoved;
|
||||
Triggers.CollectionChanged += Triggers_CollectionChanged;
|
||||
}
|
||||
|
||||
public void BeginUpdate()
|
||||
{
|
||||
updateCount++;
|
||||
}
|
||||
|
||||
public void EndUpdate()
|
||||
{
|
||||
if (--updateCount == 0)
|
||||
{
|
||||
Update();
|
||||
}
|
||||
}
|
||||
|
||||
public void InitTheater(GameType gameType)
|
||||
{
|
||||
foreach (var templateType in TemplateTypes)
|
||||
{
|
||||
templateType.Init(Theater);
|
||||
}
|
||||
|
||||
foreach (var smudgeType in SmudgeTypes)
|
||||
{
|
||||
smudgeType.Init(Theater);
|
||||
}
|
||||
|
||||
foreach (var overlayType in OverlayTypes)
|
||||
{
|
||||
overlayType.Init(Theater);
|
||||
}
|
||||
|
||||
foreach (var terrainType in TerrainTypes)
|
||||
{
|
||||
terrainType.Init(Theater);
|
||||
}
|
||||
|
||||
foreach (var infantryType in InfantryTypes)
|
||||
{
|
||||
infantryType.Init(gameType, Theater, HouseTypes.Where(h => h.Equals(infantryType.OwnerHouse)).FirstOrDefault(), DirectionTypes.Where(d => d.Facing == FacingType.South).First());
|
||||
}
|
||||
|
||||
foreach (var unitType in UnitTypes)
|
||||
{
|
||||
unitType.Init(gameType, Theater, HouseTypes.Where(h => h.Equals(unitType.OwnerHouse)).FirstOrDefault(), DirectionTypes.Where(d => d.Facing == FacingType.North).First());
|
||||
}
|
||||
|
||||
foreach (var buildingType in BuildingTypes)
|
||||
{
|
||||
buildingType.Init(gameType, Theater, HouseTypes.Where(h => h.Equals(buildingType.OwnerHouse)).FirstOrDefault(), DirectionTypes.Where(d => d.Facing == FacingType.North).First());
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
updating = true;
|
||||
|
||||
if (invalidateLayers.TryGetValue(MapLayerFlag.Resources, out ISet<Point> locations))
|
||||
{
|
||||
UpdateResourceOverlays(locations);
|
||||
}
|
||||
|
||||
if (invalidateLayers.TryGetValue(MapLayerFlag.Walls, out locations))
|
||||
{
|
||||
UpdateWallOverlays(locations);
|
||||
}
|
||||
|
||||
if (invalidateOverlappers)
|
||||
{
|
||||
Overlappers.Clear();
|
||||
foreach (var (location, techno) in Technos)
|
||||
{
|
||||
if (techno is ICellOverlapper)
|
||||
{
|
||||
Overlappers.Add(location, techno as ICellOverlapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
invalidateLayers.Clear();
|
||||
invalidateOverlappers = false;
|
||||
updating = false;
|
||||
}
|
||||
|
||||
private void UpdateResourceOverlays(ISet<Point> locations)
|
||||
{
|
||||
var tiberiumCounts = new int[] { 0, 1, 3, 4, 6, 7, 8, 10, 11 };
|
||||
var gemCounts = new int[] { 0, 0, 0, 1, 1, 1, 2, 2, 2 };
|
||||
|
||||
foreach (var (cell, overlay) in Overlay.IntersectsWith(locations).Where(o => o.Value.Type.IsResource))
|
||||
{
|
||||
int count = 0;
|
||||
foreach (var facing in CellMetrics.AdjacentFacings)
|
||||
{
|
||||
var adjacentTiberium = Overlay.Adjacent(cell, facing);
|
||||
if (adjacentTiberium?.Type.IsResource ?? false)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
overlay.Icon = overlay.Type.IsGem ? gemCounts[count] : tiberiumCounts[count];
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateWallOverlays(ISet<Point> locations)
|
||||
{
|
||||
foreach (var (cell, overlay) in Overlay.IntersectsWith(locations).Where(o => o.Value.Type.IsWall))
|
||||
{
|
||||
var northWall = Overlay.Adjacent(cell, FacingType.North);
|
||||
var eastWall = Overlay.Adjacent(cell, FacingType.East);
|
||||
var southWall = Overlay.Adjacent(cell, FacingType.South);
|
||||
var westWall = Overlay.Adjacent(cell, FacingType.West);
|
||||
|
||||
int icon = 0;
|
||||
if (northWall?.Type == overlay.Type)
|
||||
{
|
||||
icon |= 1;
|
||||
}
|
||||
if (eastWall?.Type == overlay.Type)
|
||||
{
|
||||
icon |= 2;
|
||||
}
|
||||
if (southWall?.Type == overlay.Type)
|
||||
{
|
||||
icon |= 4;
|
||||
}
|
||||
if (westWall?.Type == overlay.Type)
|
||||
{
|
||||
icon |= 8;
|
||||
}
|
||||
|
||||
overlay.Icon = icon;
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveBibs(Building building)
|
||||
{
|
||||
var bibCells = Smudge.IntersectsWith(building.BibCells).Where(x => (x.Value.Type.Flag & SmudgeTypeFlag.Bib) != SmudgeTypeFlag.None).Select(x => x.Cell).ToArray();
|
||||
foreach (var cell in bibCells)
|
||||
{
|
||||
Smudge[cell] = null;
|
||||
}
|
||||
building.BibCells.Clear();
|
||||
}
|
||||
|
||||
private void AddBibs(Point location, Building building)
|
||||
{
|
||||
if (!building.Type.HasBib)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var bib1Type = SmudgeTypes.Where(t => t.Flag == SmudgeTypeFlag.Bib1).FirstOrDefault();
|
||||
var bib2Type = SmudgeTypes.Where(t => t.Flag == SmudgeTypeFlag.Bib2).FirstOrDefault();
|
||||
var bib3Type = SmudgeTypes.Where(t => t.Flag == SmudgeTypeFlag.Bib3).FirstOrDefault();
|
||||
|
||||
SmudgeType bibType = null;
|
||||
switch (building.Type.Size.Width)
|
||||
{
|
||||
case 2:
|
||||
bibType = bib3Type;
|
||||
break;
|
||||
case 3:
|
||||
bibType = bib2Type;
|
||||
break;
|
||||
case 4:
|
||||
bibType = bib1Type;
|
||||
break;
|
||||
}
|
||||
if (bibType != null)
|
||||
{
|
||||
int icon = 0;
|
||||
for (var y = 0; y < bibType.Size.Height; ++y)
|
||||
{
|
||||
for (var x = 0; x < bibType.Size.Width; ++x, ++icon)
|
||||
{
|
||||
if (Metrics.GetCell(new Point(location.X + x, location.Y + building.Type.Size.Height + y - 1), out int subCell))
|
||||
{
|
||||
Smudge[subCell] = new Smudge
|
||||
{
|
||||
Type = bibType,
|
||||
Icon = icon,
|
||||
Data = 0,
|
||||
Tint = building.Tint
|
||||
};
|
||||
building.BibCells.Add(subCell);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Map Clone()
|
||||
{
|
||||
var map = new Map(BasicSection, Theater, Metrics.Size, HouseType,
|
||||
HouseTypes, TheaterTypes, TemplateTypes, TerrainTypes, OverlayTypes, SmudgeTypes,
|
||||
EventTypes, ActionTypes, MissionTypes, DirectionTypes, InfantryTypes, UnitTypes,
|
||||
BuildingTypes, TeamMissionTypes, Waypoints, MovieTypes)
|
||||
{
|
||||
TopLeft = TopLeft,
|
||||
Size = Size
|
||||
};
|
||||
|
||||
map.BeginUpdate();
|
||||
|
||||
MapSection.CopyTo(map.MapSection);
|
||||
BriefingSection.CopyTo(map.BriefingSection);
|
||||
SteamSection.CopyTo(map.SteamSection);
|
||||
Templates.CopyTo(map.Templates);
|
||||
Overlay.CopyTo(map.Overlay);
|
||||
Smudge.CopyTo(map.Smudge);
|
||||
CellTriggers.CopyTo(map.CellTriggers);
|
||||
Array.Copy(Houses, map.Houses, map.Houses.Length);
|
||||
|
||||
foreach (var trigger in Triggers)
|
||||
{
|
||||
map.Triggers.Add(trigger);
|
||||
}
|
||||
|
||||
foreach (var (location, occupier) in Technos)
|
||||
{
|
||||
if (occupier is InfantryGroup infantryGroup)
|
||||
{
|
||||
var newInfantryGroup = new InfantryGroup();
|
||||
Array.Copy(infantryGroup.Infantry, newInfantryGroup.Infantry, newInfantryGroup.Infantry.Length);
|
||||
map.Technos.Add(location, newInfantryGroup);
|
||||
}
|
||||
else if (!(occupier is Building))
|
||||
{
|
||||
map.Technos.Add(location, occupier);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var (location, building) in Buildings)
|
||||
{
|
||||
map.Buildings.Add(location, building);
|
||||
}
|
||||
|
||||
map.TeamTypes.AddRange(TeamTypes);
|
||||
|
||||
map.EndUpdate();
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
public TGA GeneratePreview(Size previewSize, bool sharpen)
|
||||
{
|
||||
var mapBounds = new Rectangle(
|
||||
Bounds.Left * Globals.OriginalTileWidth,
|
||||
Bounds.Top * Globals.OriginalTileHeight,
|
||||
Bounds.Width * Globals.OriginalTileWidth,
|
||||
Bounds.Height * Globals.OriginalTileHeight
|
||||
);
|
||||
var previewScale = Math.Min(previewSize.Width / (float)mapBounds.Width, previewSize.Height / (float)mapBounds.Height);
|
||||
var scaledSize = new Size((int)(previewSize.Width / previewScale), (int)(previewSize.Height / previewScale));
|
||||
|
||||
using (var fullBitmap = new Bitmap(Metrics.Width * Globals.OriginalTileWidth, Metrics.Height * Globals.OriginalTileHeight))
|
||||
using (var croppedBitmap = new Bitmap(previewSize.Width, previewSize.Height))
|
||||
{
|
||||
var locations = Bounds.Points().ToHashSet();
|
||||
using (var g = Graphics.FromImage(fullBitmap))
|
||||
{
|
||||
MapRenderer.Render(GameType.None, this, g, locations, MapLayerFlag.Template | MapLayerFlag.Resources, 1);
|
||||
}
|
||||
|
||||
using (var g = Graphics.FromImage(croppedBitmap))
|
||||
{
|
||||
Matrix transform = new Matrix();
|
||||
transform.Scale(previewScale, previewScale);
|
||||
transform.Translate((scaledSize.Width - mapBounds.Width) / 2, (scaledSize.Height - mapBounds.Height) / 2);
|
||||
|
||||
g.Transform = transform;
|
||||
g.Clear(Color.Black);
|
||||
g.DrawImage(fullBitmap, new Rectangle(0, 0, mapBounds.Width, mapBounds.Height), mapBounds, GraphicsUnit.Pixel);
|
||||
}
|
||||
|
||||
fullBitmap.Dispose();
|
||||
|
||||
if (sharpen)
|
||||
{
|
||||
using (var sharpenedImage = croppedBitmap.Sharpen(1.0f))
|
||||
{
|
||||
croppedBitmap.Dispose();
|
||||
return TGA.FromBitmap(sharpenedImage);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return TGA.FromBitmap(croppedBitmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public TGA GenerateMapPreview()
|
||||
{
|
||||
return GeneratePreview(Globals.MapPreviewSize, false);
|
||||
}
|
||||
|
||||
public TGA GenerateWorkshopPreview()
|
||||
{
|
||||
return GeneratePreview(Globals.WorkshopPreviewSize, true);
|
||||
}
|
||||
|
||||
object ICloneable.Clone()
|
||||
{
|
||||
return Clone();
|
||||
}
|
||||
|
||||
private void Overlay_CellChanged(object sender, CellChangedEventArgs<Overlay> e)
|
||||
{
|
||||
if (e.OldValue?.Type.IsWall ?? false)
|
||||
{
|
||||
Buildings.Remove(e.OldValue);
|
||||
}
|
||||
|
||||
if (e.Value?.Type.IsWall ?? false)
|
||||
{
|
||||
Buildings.Add(e.Location, e.Value);
|
||||
}
|
||||
|
||||
if (updating)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var overlay in new Overlay[] { e.OldValue, e.Value })
|
||||
{
|
||||
if (overlay == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
MapLayerFlag layer = MapLayerFlag.None;
|
||||
if (overlay.Type.IsResource)
|
||||
{
|
||||
layer = MapLayerFlag.Resources;
|
||||
}
|
||||
else if (overlay.Type.IsWall)
|
||||
{
|
||||
layer = MapLayerFlag.Walls;
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!invalidateLayers.TryGetValue(layer, out ISet<Point> locations))
|
||||
{
|
||||
locations = new HashSet<Point>();
|
||||
invalidateLayers[layer] = locations;
|
||||
}
|
||||
|
||||
locations.UnionWith(Rectangle.Inflate(new Rectangle(e.Location, new Size(1, 1)), 1, 1).Points());
|
||||
}
|
||||
|
||||
if (updateCount == 0)
|
||||
{
|
||||
Update();
|
||||
}
|
||||
}
|
||||
|
||||
private void Technos_OccupierAdded(object sender, OccupierAddedEventArgs<ICellOccupier> e)
|
||||
{
|
||||
if (e.Occupier is ICellOverlapper overlapper)
|
||||
{
|
||||
if (updateCount == 0)
|
||||
{
|
||||
Overlappers.Add(e.Location, overlapper);
|
||||
}
|
||||
else
|
||||
{
|
||||
invalidateOverlappers = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Technos_OccupierRemoved(object sender, OccupierRemovedEventArgs<ICellOccupier> e)
|
||||
{
|
||||
if (e.Occupier is ICellOverlapper overlapper)
|
||||
{
|
||||
if (updateCount == 0)
|
||||
{
|
||||
Overlappers.Remove(overlapper);
|
||||
}
|
||||
else
|
||||
{
|
||||
invalidateOverlappers = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Buildings_OccupierAdded(object sender, OccupierAddedEventArgs<ICellOccupier> e)
|
||||
{
|
||||
if (e.Occupier is Building building)
|
||||
{
|
||||
Technos.Add(e.Location, e.Occupier, building.Type.BaseOccupyMask);
|
||||
AddBibs(e.Location, building);
|
||||
}
|
||||
else
|
||||
{
|
||||
Technos.Add(e.Location, e.Occupier);
|
||||
}
|
||||
}
|
||||
|
||||
private void Buildings_OccupierRemoved(object sender, OccupierRemovedEventArgs<ICellOccupier> e)
|
||||
{
|
||||
if (e.Occupier is Building building)
|
||||
{
|
||||
RemoveBibs(building);
|
||||
}
|
||||
|
||||
Technos.Remove(e.Occupier);
|
||||
}
|
||||
|
||||
private void Triggers_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
foreach (var (_, building) in Buildings.OfType<Building>())
|
||||
{
|
||||
if (!string.IsNullOrEmpty(building.Trigger))
|
||||
{
|
||||
if (Triggers.Where(t => building.Trigger.Equals(t.Name)).FirstOrDefault() == null)
|
||||
{
|
||||
building.Trigger = Trigger.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class TheaterTypeConverter : TypeConverter
|
||||
{
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
|
||||
{
|
||||
return (context is MapContext) && (sourceType == typeof(string));
|
||||
}
|
||||
|
||||
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
|
||||
{
|
||||
return (context is MapContext) && (destinationType == typeof(string));
|
||||
}
|
||||
|
||||
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (!(value is TheaterType) || !CanConvertTo(context, destinationType))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return (value as TheaterType)?.Name;
|
||||
}
|
||||
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
|
||||
{
|
||||
if (!CanConvertFrom(context, value?.GetType()))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var map = (context as MapContext).Map;
|
||||
return map.TheaterTypes.Where(t => t.Equals(value)).FirstOrDefault() ?? map.TheaterTypes.First();
|
||||
}
|
||||
}
|
||||
|
||||
public class MapSection : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
private int x;
|
||||
[DefaultValue(0)]
|
||||
public int X { get => x; set => SetField(ref x, value); }
|
||||
|
||||
private int y;
|
||||
[DefaultValue(0)]
|
||||
public int Y { get => y; set => SetField(ref y, value); }
|
||||
|
||||
private int width;
|
||||
[DefaultValue(0)]
|
||||
public int Width { get => width; set => SetField(ref width, value); }
|
||||
|
||||
private int height;
|
||||
[DefaultValue(0)]
|
||||
public int Height { get => height; set => SetField(ref height, value); }
|
||||
|
||||
private TheaterType theater;
|
||||
[TypeConverter(typeof(TheaterTypeConverter))]
|
||||
[DefaultValue(null)]
|
||||
public TheaterType Theater { get => theater; set => SetField(ref theater, value); }
|
||||
|
||||
protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
|
||||
{
|
||||
if (EqualityComparer<T>.Default.Equals(field, value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
field = value;
|
||||
OnPropertyChanged(propertyName);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,250 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class OccupierAddedEventArgs<T> : EventArgs
|
||||
{
|
||||
public readonly int Cell;
|
||||
|
||||
public readonly Point Location;
|
||||
|
||||
public readonly T Occupier;
|
||||
|
||||
public OccupierAddedEventArgs(CellMetrics metrics, int cell, T occupier)
|
||||
{
|
||||
Cell = cell;
|
||||
metrics.GetLocation(cell, out Location);
|
||||
Occupier = occupier;
|
||||
}
|
||||
|
||||
public OccupierAddedEventArgs(CellMetrics metrics, Point location, T occupier)
|
||||
{
|
||||
Location = location;
|
||||
metrics.GetCell(location, out Cell);
|
||||
Occupier = occupier;
|
||||
}
|
||||
}
|
||||
|
||||
public class OccupierRemovedEventArgs<T> : EventArgs
|
||||
{
|
||||
public readonly int Cell;
|
||||
|
||||
public readonly Point Location;
|
||||
|
||||
public readonly T Occupier;
|
||||
|
||||
public OccupierRemovedEventArgs(CellMetrics metrics, int cell, T occupier)
|
||||
{
|
||||
Cell = cell;
|
||||
metrics.GetLocation(cell, out Location);
|
||||
Occupier = occupier;
|
||||
}
|
||||
|
||||
public OccupierRemovedEventArgs(CellMetrics metrics, Point location, T occupier)
|
||||
{
|
||||
Location = location;
|
||||
metrics.GetCell(location, out Cell);
|
||||
Occupier = occupier;
|
||||
}
|
||||
}
|
||||
|
||||
public class OccupierSet<T> : IEnumerable<(Point Location, T Occupier)>, IEnumerable where T : class, ICellOccupier
|
||||
{
|
||||
private readonly CellMetrics metrics;
|
||||
private readonly Dictionary<T, Point> occupiers = new Dictionary<T, Point>();
|
||||
private readonly T[,] occupierCells;
|
||||
|
||||
public T this[Point location] => this[location.X, location.Y];
|
||||
|
||||
public T this[int x, int y] => Contains(x, y) ? occupierCells[y, x] : null;
|
||||
|
||||
public T this[int cell] => metrics.GetLocation(cell, out Point location) ? this[location] : null;
|
||||
|
||||
public Point? this[T occupier] => occupiers.ContainsKey(occupier) ? occupiers[occupier] : default;
|
||||
|
||||
public IEnumerable<T> Occupiers => occupiers.Keys;
|
||||
|
||||
public event EventHandler<OccupierAddedEventArgs<T>> OccupierAdded;
|
||||
public event EventHandler<OccupierRemovedEventArgs<T>> OccupierRemoved;
|
||||
public event EventHandler<EventArgs> Cleared;
|
||||
|
||||
public OccupierSet(CellMetrics metrics)
|
||||
{
|
||||
this.metrics = metrics;
|
||||
occupierCells = new T[metrics.Height, metrics.Width];
|
||||
}
|
||||
|
||||
public bool CanAdd(Point location, T occupier, bool[,] occupyMask)
|
||||
{
|
||||
if ((occupier == null) || Contains(occupier))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var occupyPoints = GetOccupyPoints(location, occupyMask).ToArray();
|
||||
return !occupyPoints.Any(p => !Contains(p) || (this[p] != null));
|
||||
}
|
||||
|
||||
public bool CanAdd(int x, int y, T occupier, bool[,] occupyMask) => CanAdd(new Point(x, y), occupier, occupyMask);
|
||||
|
||||
public bool CanAdd(int cell, T occupier, bool[,] occupyMask) => metrics.GetLocation(cell, out Point location) ? CanAdd(location, occupier, occupyMask) : false;
|
||||
|
||||
public bool CanAdd(Point location, T occupier) => (occupier != null) ? CanAdd(location, occupier, occupier.OccupyMask) : false;
|
||||
|
||||
public bool CanAdd(int x, int y, T occupier) => (occupier != null) ? CanAdd(x, y, occupier, occupier.OccupyMask) : false;
|
||||
|
||||
public bool CanAdd(int cell, T occupier) => (occupier != null) ? CanAdd(cell, occupier, occupier.OccupyMask) : false;
|
||||
|
||||
public bool Add(Point location, T occupier, bool[,] occupyMask)
|
||||
{
|
||||
if (!DoAdd(location, occupier, occupyMask))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
OnOccupierAdded(new OccupierAddedEventArgs<T>(metrics, location, occupier));
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Add(int x, int y, T occupier, bool[,] occupyMask) => Add(new Point(x, y), occupier, occupyMask);
|
||||
|
||||
public bool Add(int cell, T occupier, bool[,] occupyMask) => metrics.GetLocation(cell, out Point location) ? Add(location, occupier, occupyMask) : false;
|
||||
|
||||
public bool Add(Point location, T occupier) => (occupier != null) ? Add(location, occupier, occupier.OccupyMask) : false;
|
||||
|
||||
public bool Add(int x, int y, T occupier) => (occupier != null) ? Add(x, y, occupier, occupier.OccupyMask) : false;
|
||||
|
||||
public bool Add(int cell, T occupier) => (occupier != null) ? Add(cell, occupier, occupier.OccupyMask) : false;
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
occupiers.Clear();
|
||||
Array.Clear(occupierCells, 0, occupierCells.Length);
|
||||
OnCleared();
|
||||
}
|
||||
|
||||
public bool Contains(int x, int y) => ((x >= 0) && (x < occupierCells.GetLength(1)) && (y >= 0) && (y < occupierCells.GetLength(0)));
|
||||
|
||||
public bool Contains(Point location) => Contains(location.X, location.Y);
|
||||
|
||||
public bool Contains(int cell) => metrics.GetLocation(cell, out Point location) ? Contains(location) : false;
|
||||
|
||||
public bool Contains(T occupier) => occupiers.ContainsKey(occupier);
|
||||
|
||||
public IEnumerator<(Point Location, T Occupier)> GetEnumerator() => occupiers.Select(kv => (kv.Value, kv.Key)).GetEnumerator();
|
||||
|
||||
public bool Remove(T occupier)
|
||||
{
|
||||
var oldLocation = this[occupier];
|
||||
if (!DoRemove(occupier))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
OnOccupierRemoved(new OccupierRemovedEventArgs<T>(metrics, oldLocation.Value, occupier));
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Remove(Point location) => Remove(this[location]);
|
||||
|
||||
public bool Remove(int x, int y) => Remove(new Point(x, y));
|
||||
|
||||
public bool Remove(int cell) => metrics.GetLocation(cell, out Point location) ? Remove(location) : false;
|
||||
|
||||
public IEnumerable<(Point Location, U Occupier)> OfType<U>() where U : T => this.Where(i => i.Occupier is U).Select(i => (i.Location, (U)i.Occupier));
|
||||
|
||||
protected virtual void OnOccupierAdded(OccupierAddedEventArgs<T> e)
|
||||
{
|
||||
OccupierAdded?.Invoke(this, e);
|
||||
}
|
||||
|
||||
protected virtual void OnOccupierRemoved(OccupierRemovedEventArgs<T> e)
|
||||
{
|
||||
OccupierRemoved?.Invoke(this, e);
|
||||
}
|
||||
|
||||
protected virtual void OnCleared()
|
||||
{
|
||||
Cleared?.Invoke(this, new EventArgs());
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
private bool DoAdd(Point location, T occupier, bool[,] occupyMask)
|
||||
{
|
||||
if ((occupier == null) || Contains(occupier))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var occupyPoints = GetOccupyPoints(location, occupyMask).ToArray();
|
||||
if (occupyPoints.Any(p => !Contains(p) || (this[p] != null)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
occupiers[occupier] = location;
|
||||
foreach (var p in occupyPoints)
|
||||
{
|
||||
occupierCells[p.Y, p.X] = occupier;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool DoRemove(T occupier)
|
||||
{
|
||||
if ((occupier == null) || !occupiers.TryGetValue(occupier, out Point location))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
occupiers.Remove(occupier);
|
||||
for (var y = location.Y; y < metrics.Height; ++y)
|
||||
{
|
||||
for (var x = location.X; x < metrics.Width; ++x)
|
||||
{
|
||||
if (occupierCells[y, x] == occupier)
|
||||
{
|
||||
occupierCells[y, x] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static IEnumerable<Point> GetOccupyPoints(Point location, bool[,] occupyMask)
|
||||
{
|
||||
for (var y = 0; y < occupyMask.GetLength(0); ++y)
|
||||
{
|
||||
for (var x = 0; x < occupyMask.GetLength(1); ++x)
|
||||
{
|
||||
if (occupyMask[y, x])
|
||||
{
|
||||
yield return location + new Size(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerable<Point> GetOccupyPoints(Point location, T occupier) => GetOccupyPoints(location, occupier.OccupyMask);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Utility;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class OverlapperSet<T> : IEnumerable<(Point Location, T Overlapper)>, IEnumerable where T : class, ICellOverlapper
|
||||
{
|
||||
private readonly CellMetrics metrics;
|
||||
private readonly Dictionary<T, Rectangle> overlappers = new Dictionary<T, Rectangle>();
|
||||
|
||||
public Rectangle? this[T overlapper] => Contains(overlapper) ? overlappers[overlapper] : default;
|
||||
|
||||
public IEnumerable<T> Overlappers => overlappers.Keys;
|
||||
|
||||
public OverlapperSet(CellMetrics metrics)
|
||||
{
|
||||
this.metrics = metrics;
|
||||
}
|
||||
|
||||
public bool Add(Point location, T overlapper)
|
||||
{
|
||||
if ((overlapper == null) || Contains(overlapper))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var rectangle = overlapper.OverlapBounds;
|
||||
rectangle.Offset(location);
|
||||
overlappers[overlapper] = rectangle;
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Add(int x, int y, T occupier) => Add(new Point(x, y), occupier);
|
||||
|
||||
public bool Add(int cell, T overlapper) => metrics.GetLocation(cell, out Point location) ? Add(location, overlapper) : false;
|
||||
|
||||
public void Clear() => overlappers.Clear();
|
||||
|
||||
public bool Contains(T occupier) => overlappers.ContainsKey(occupier);
|
||||
|
||||
public void CopyTo(OverlapperSet<T> other)
|
||||
{
|
||||
foreach (var (Location, Occupier) in this)
|
||||
{
|
||||
other.Add(Location, Occupier);
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator<(Point Location, T Overlapper)> GetEnumerator() => overlappers.Select(kv => (kv.Value.Location, kv.Key)).GetEnumerator();
|
||||
|
||||
public bool Remove(T overlapper)
|
||||
{
|
||||
if ((overlapper == null) || !overlappers.TryGetValue(overlapper, out Rectangle overlapRect))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
overlappers.Remove(overlapper);
|
||||
return true;
|
||||
}
|
||||
|
||||
public ISet<Point> Overlaps(IEnumerable<Rectangle> rectangles)
|
||||
{
|
||||
var rectangleSet = new HashSet<Rectangle>(rectangles);
|
||||
while (true)
|
||||
{
|
||||
var count = rectangleSet.Count;
|
||||
var overlap = overlappers.Values.Where(x => rectangleSet.Any(y => x.IntersectsWith(y))).ToArray();
|
||||
rectangleSet.UnionWith(overlap);
|
||||
if (rectangleSet.Count == count)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return rectangleSet.SelectMany(x => x.Points()).ToHashSet();
|
||||
}
|
||||
|
||||
public ISet<Point> Overlaps(Rectangle rectangle) => Overlaps(rectangle.Yield());
|
||||
|
||||
public ISet<Point> Overlaps(IEnumerable<Point> points) => Overlaps(points.Select(p => new Rectangle(p, new Size(1, 1))));
|
||||
|
||||
public ISet<Point> Overlaps(Point point) => Overlaps(point.Yield());
|
||||
|
||||
public IEnumerable<(Point Location, U Overlapper)> OfType<U>() where U : T => this.Where(i => i.Overlapper is U).Select(i => (i.Location, (U)i.Overlapper));
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using System.Drawing;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class Overlay : ICellOccupier
|
||||
{
|
||||
public OverlayType Type { get; set; }
|
||||
|
||||
public int Icon { get; set; }
|
||||
|
||||
public Size OverlapSize => new Size(1, 1);
|
||||
|
||||
public bool[,] OccupyMask => Type.OccupyMask;
|
||||
|
||||
public Color Tint { get; set; } = Color.White;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
[Flags]
|
||||
public enum OverlayTypeFlag
|
||||
{
|
||||
None = 0,
|
||||
TiberiumOrGold = (1 << 0),
|
||||
Gems = (1 << 1),
|
||||
Wall = (1 << 2),
|
||||
Crate = (1 << 3),
|
||||
Flag = (1 << 4),
|
||||
}
|
||||
|
||||
public class OverlayType : ICellOccupier, IBrowsableType
|
||||
{
|
||||
public sbyte ID { get; private set; }
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
public string DisplayName { get; private set; }
|
||||
|
||||
public TheaterType[] Theaters { get; private set; }
|
||||
|
||||
public OverlayTypeFlag Flag { get; private set; }
|
||||
|
||||
public Image Thumbnail { get; set; }
|
||||
|
||||
public bool[,] OccupyMask => new bool[1, 1] { { true } };
|
||||
|
||||
public bool IsResource => (Flag & (OverlayTypeFlag.TiberiumOrGold | OverlayTypeFlag.Gems)) != OverlayTypeFlag.None;
|
||||
|
||||
public bool IsTiberiumOrGold => (Flag & OverlayTypeFlag.TiberiumOrGold) != OverlayTypeFlag.None;
|
||||
|
||||
public bool IsGem => (Flag & OverlayTypeFlag.Gems) != OverlayTypeFlag.None;
|
||||
|
||||
public bool IsWall => (Flag & OverlayTypeFlag.Wall) != OverlayTypeFlag.None;
|
||||
|
||||
public bool IsCrate => (Flag & OverlayTypeFlag.Crate) != OverlayTypeFlag.None;
|
||||
|
||||
public bool IsFlag => (Flag & OverlayTypeFlag.Flag) != OverlayTypeFlag.None;
|
||||
|
||||
public bool IsPlaceable => (Flag & ~OverlayTypeFlag.Crate) == OverlayTypeFlag.None;
|
||||
|
||||
public OverlayType(sbyte id, string name, string textId, TheaterType[] theaters, OverlayTypeFlag flag)
|
||||
{
|
||||
ID = id;
|
||||
Name = name;
|
||||
DisplayName = Globals.TheGameTextManager[textId];
|
||||
Theaters = theaters;
|
||||
Flag = flag;
|
||||
}
|
||||
|
||||
public OverlayType(sbyte id, string name, string textId, OverlayTypeFlag flag)
|
||||
: this(id, name, textId, null, flag)
|
||||
{
|
||||
}
|
||||
|
||||
public OverlayType(sbyte id, string name, string textId, TheaterType[] theaters)
|
||||
: this(id, name, textId, theaters, OverlayTypeFlag.None)
|
||||
{
|
||||
}
|
||||
|
||||
public OverlayType(sbyte id, string name, OverlayTypeFlag flag)
|
||||
: this(id, name, name, null, flag)
|
||||
{
|
||||
}
|
||||
|
||||
public OverlayType(sbyte id, string name, string textId)
|
||||
: this(id, name, textId, null, OverlayTypeFlag.None)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is OverlayType)
|
||||
{
|
||||
return this == obj;
|
||||
}
|
||||
else if (obj is sbyte)
|
||||
{
|
||||
return ID == (sbyte)obj;
|
||||
}
|
||||
else if (obj is string)
|
||||
{
|
||||
return string.Equals(Name, obj as string, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ID.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
public void Init(TheaterType theater)
|
||||
{
|
||||
if (Globals.TheTilesetManager.GetTileData(theater.Tilesets, Name, 0, out Tile tile))
|
||||
{
|
||||
Thumbnail = new Bitmap(tile.Image, tile.Image.Width, tile.Image.Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using System.Drawing;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class Smudge
|
||||
{
|
||||
public SmudgeType Type { get; set; }
|
||||
|
||||
public int Icon { get; set; }
|
||||
|
||||
public int Data { get; set; }
|
||||
|
||||
public Color Tint { get; set; } = Color.White;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
[Flags]
|
||||
public enum SmudgeTypeFlag
|
||||
{
|
||||
None = 0,
|
||||
Bib = 1,
|
||||
Bib1 = 3,
|
||||
Bib2 = 5,
|
||||
Bib3 = 9,
|
||||
}
|
||||
|
||||
public class SmudgeType : IBrowsableType
|
||||
{
|
||||
public sbyte ID { get; private set; }
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
public string DisplayName => Name;
|
||||
|
||||
public Size Size { get; set; }
|
||||
|
||||
public SmudgeTypeFlag Flag { get; private set; }
|
||||
|
||||
public Size RenderSize { get; set; }
|
||||
|
||||
public Image Thumbnail { get; set; }
|
||||
|
||||
public SmudgeType(sbyte id, string name, Size size, SmudgeTypeFlag flag)
|
||||
{
|
||||
ID = id;
|
||||
Name = name;
|
||||
Size = size;
|
||||
Flag = flag;
|
||||
}
|
||||
|
||||
public SmudgeType(sbyte id, string name, Size size)
|
||||
: this(id, name, size, SmudgeTypeFlag.None)
|
||||
{
|
||||
}
|
||||
|
||||
public SmudgeType(sbyte id, string name)
|
||||
: this(id, name, new Size(1, 1), SmudgeTypeFlag.None)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is SmudgeType)
|
||||
{
|
||||
return this == obj;
|
||||
}
|
||||
else if (obj is sbyte)
|
||||
{
|
||||
return ID == (sbyte)obj;
|
||||
}
|
||||
else if (obj is string)
|
||||
{
|
||||
return string.Equals(Name, obj as string, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ID.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
public void Init(TheaterType theater)
|
||||
{
|
||||
if (Globals.TheTilesetManager.GetTileData(theater.Tilesets, Name, 0, out Tile tile))
|
||||
{
|
||||
if ((tile.Image.Width * Globals.TileHeight) > (tile.Image.Height * Globals.TileWidth))
|
||||
{
|
||||
RenderSize = new Size(
|
||||
tile.Image.Width * Globals.TileWidth / tile.Image.Width,
|
||||
tile.Image.Height * Globals.TileWidth / tile.Image.Width
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
RenderSize = new Size(
|
||||
tile.Image.Width * Globals.TileHeight / tile.Image.Height,
|
||||
tile.Image.Height * Globals.TileHeight / tile.Image.Height
|
||||
);
|
||||
}
|
||||
Thumbnail = new Bitmap(tile.Image, tile.Image.Width, tile.Image.Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using Steamworks;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class SteamSection
|
||||
{
|
||||
[DefaultValue(null)]
|
||||
public string Title { get; set; }
|
||||
|
||||
[DefaultValue(null)]
|
||||
public string Description { get; set; }
|
||||
|
||||
[DefaultValue(null)]
|
||||
public string PreviewFile { get; set; }
|
||||
|
||||
[DefaultValue(ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic)]
|
||||
public ERemoteStoragePublishedFileVisibility Visibility { get; set; }
|
||||
|
||||
[DefaultValue(typeof(ulong), "0")]
|
||||
public ulong PublishedFileId { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,158 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class TeamTypeClass : ICloneable
|
||||
{
|
||||
public ITechnoType Type { get; set; }
|
||||
|
||||
public byte Count { get; set; }
|
||||
|
||||
public TeamTypeClass Clone()
|
||||
{
|
||||
return new TeamTypeClass()
|
||||
{
|
||||
Type = Type,
|
||||
Count = Count
|
||||
};
|
||||
}
|
||||
|
||||
object ICloneable.Clone()
|
||||
{
|
||||
return Clone();
|
||||
}
|
||||
}
|
||||
|
||||
public class TeamTypeMission : ICloneable
|
||||
{
|
||||
public string Mission { get; set; }
|
||||
|
||||
public int Argument { get; set; }
|
||||
|
||||
public TeamTypeMission Clone()
|
||||
{
|
||||
return new TeamTypeMission()
|
||||
{
|
||||
Mission = Mission,
|
||||
Argument = Argument
|
||||
};
|
||||
}
|
||||
|
||||
object ICloneable.Clone()
|
||||
{
|
||||
return Clone();
|
||||
}
|
||||
}
|
||||
|
||||
public class TeamType : INamedType, ICloneable
|
||||
{
|
||||
public static readonly string None = "None";
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public HouseType House { get; set; }
|
||||
|
||||
public bool IsRoundAbout { get; set; }
|
||||
|
||||
public bool IsLearning { get; set; }
|
||||
|
||||
public bool IsSuicide { get; set; }
|
||||
|
||||
public bool IsAutocreate { get; set; }
|
||||
|
||||
public bool IsMercenary { get; set; }
|
||||
|
||||
public int RecruitPriority { get; set; }
|
||||
|
||||
public byte MaxAllowed { get; set; }
|
||||
|
||||
public byte InitNum { get; set; }
|
||||
|
||||
public byte Fear { get; set; }
|
||||
|
||||
public bool IsReinforcable { get; set; }
|
||||
|
||||
public bool IsPrebuilt { get; set; }
|
||||
|
||||
public int Origin { get; set; }
|
||||
|
||||
public string Trigger { get; set; } = Model.Trigger.None;
|
||||
|
||||
public List<TeamTypeClass> Classes { get; } = new List<TeamTypeClass>();
|
||||
|
||||
public List<TeamTypeMission> Missions { get; } = new List<TeamTypeMission>();
|
||||
|
||||
public TeamType Clone()
|
||||
{
|
||||
var teamType = new TeamType()
|
||||
{
|
||||
Name = Name,
|
||||
House = House,
|
||||
IsRoundAbout = IsRoundAbout,
|
||||
IsLearning = IsLearning,
|
||||
IsSuicide = IsSuicide,
|
||||
IsAutocreate = IsAutocreate,
|
||||
IsMercenary = IsMercenary,
|
||||
RecruitPriority = RecruitPriority,
|
||||
MaxAllowed = MaxAllowed,
|
||||
InitNum = InitNum,
|
||||
Fear = Fear,
|
||||
IsReinforcable = IsReinforcable,
|
||||
IsPrebuilt = IsPrebuilt,
|
||||
Origin = Origin,
|
||||
Trigger = Trigger
|
||||
};
|
||||
|
||||
teamType.Classes.AddRange(Classes.Select(c => c.Clone()));
|
||||
teamType.Missions.AddRange(Missions.Select(m => m.Clone()));
|
||||
|
||||
return teamType;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is TeamType)
|
||||
{
|
||||
return this == obj;
|
||||
}
|
||||
else if (obj is string)
|
||||
{
|
||||
return string.Equals(Name, obj as string, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Name.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
object ICloneable.Clone()
|
||||
{
|
||||
return Clone();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using System.Drawing;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class Template : ICellOccupier
|
||||
{
|
||||
public TemplateType Type { get; set; }
|
||||
|
||||
public int Icon { get; set; }
|
||||
|
||||
public Size OverlapSize => new Size(1, 1);
|
||||
|
||||
public bool[,] OccupyMask => new bool[1, 1] { { true } };
|
||||
}
|
||||
}
|
|
@ -0,0 +1,133 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
[Flags]
|
||||
public enum TemplateTypeFlag
|
||||
{
|
||||
None = 0,
|
||||
Clear = (1 << 1),
|
||||
Water = (1 << 2),
|
||||
OreMine = (1 << 3),
|
||||
}
|
||||
|
||||
public class TemplateType : IBrowsableType
|
||||
{
|
||||
public ushort ID { get; private set; }
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
public string DisplayName => Name;
|
||||
|
||||
public int IconWidth { get; private set; }
|
||||
|
||||
public int IconHeight { get; private set; }
|
||||
|
||||
public Size IconSize => new Size(IconWidth, IconHeight);
|
||||
|
||||
public int NumIcons => IconWidth * IconHeight;
|
||||
|
||||
public bool[,] IconMask { get; set; }
|
||||
|
||||
public Image Thumbnail { get; set; }
|
||||
|
||||
public TheaterType[] Theaters { get; private set; }
|
||||
|
||||
public TemplateTypeFlag Flag { get; private set; }
|
||||
|
||||
public TemplateType(ushort id, string name, int iconWidth, int iconHeight, TheaterType[] theaters, TemplateTypeFlag flag)
|
||||
{
|
||||
ID = id;
|
||||
Name = name;
|
||||
IconWidth = iconWidth;
|
||||
IconHeight = iconHeight;
|
||||
Theaters = theaters;
|
||||
Flag = flag;
|
||||
}
|
||||
|
||||
public TemplateType(ushort id, string name, int iconWidth, int iconHeight, TheaterType[] theaters)
|
||||
: this(id, name, iconWidth, iconHeight, theaters, TemplateTypeFlag.None)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is TemplateType)
|
||||
{
|
||||
return this == obj;
|
||||
}
|
||||
else if (obj is byte)
|
||||
{
|
||||
return ID == (byte)obj;
|
||||
}
|
||||
else if (obj is ushort)
|
||||
{
|
||||
return ID == (ushort)obj;
|
||||
}
|
||||
else if (obj is string)
|
||||
{
|
||||
return string.Equals(Name, obj as string, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ID.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
public void Init(TheaterType theater)
|
||||
{
|
||||
var size = new Size(Globals.OriginalTileWidth / 4, Globals.OriginalTileWidth / 4);
|
||||
var iconSize = Math.Max(IconWidth, IconHeight);
|
||||
var thumbnail = new Bitmap(iconSize * size.Width, iconSize * size.Height);
|
||||
var mask = new bool[IconWidth, IconHeight];
|
||||
Array.Clear(mask, 0, mask.Length);
|
||||
|
||||
bool found = false;
|
||||
using (var g = Graphics.FromImage(thumbnail))
|
||||
{
|
||||
g.Clear(Color.Transparent);
|
||||
|
||||
int icon = 0;
|
||||
for (var y = 0; y < IconHeight; ++y)
|
||||
{
|
||||
for (var x = 0; x < IconWidth; ++x, ++icon)
|
||||
{
|
||||
if (Globals.TheTilesetManager.GetTileData(theater.Tilesets, Name, icon, out Tile tile))
|
||||
{
|
||||
g.DrawImage(tile.Image, x * size.Width, y * size.Height, size.Width, size.Height);
|
||||
found = mask[x, y] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Thumbnail = found ? thumbnail : null;
|
||||
IconMask = mask;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Runtime.CompilerServices;
|
||||
using MobiusEditor.Interface;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class Terrain : ICellOverlapper, ICellOccupier, INotifyPropertyChanged, ICloneable
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
private TerrainType type;
|
||||
public TerrainType Type { get => type; set => SetField(ref type, value); }
|
||||
|
||||
private int icon;
|
||||
public int Icon { get => icon; set => SetField(ref icon, value); }
|
||||
|
||||
public Rectangle OverlapBounds => Type.OverlapBounds;
|
||||
|
||||
public bool[,] OccupyMask => Type.OccupyMask;
|
||||
|
||||
private string trigger = Model.Trigger.None;
|
||||
public string Trigger { get => trigger; set => SetField(ref trigger, value); }
|
||||
|
||||
public Color Tint { get; set; } = Color.White;
|
||||
|
||||
public Terrain Clone()
|
||||
{
|
||||
return new Terrain()
|
||||
{
|
||||
Type = Type,
|
||||
Icon = Icon,
|
||||
Trigger = Trigger
|
||||
};
|
||||
}
|
||||
|
||||
protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
|
||||
{
|
||||
if (EqualityComparer<T>.Default.Equals(field, value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
field = value;
|
||||
OnPropertyChanged(propertyName);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
|
||||
object ICloneable.Clone()
|
||||
{
|
||||
return Clone();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class TerrainType : ICellOverlapper, ICellOccupier, IBrowsableType
|
||||
{
|
||||
public sbyte ID { get; private set; }
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
public string DisplayName => Name;
|
||||
|
||||
public Rectangle OverlapBounds => new Rectangle(
|
||||
Point.Empty,
|
||||
new Size(((RenderSize.Width + Globals.TileWidth - 1) / Globals.TileWidth), ((RenderSize.Height + Globals.TileHeight - 1) / Globals.TileHeight))
|
||||
);
|
||||
|
||||
public bool[,] OccupyMask { get; private set; }
|
||||
|
||||
public Size Size => new Size(OccupyMask.GetLength(1), OccupyMask.GetLength(0));
|
||||
|
||||
public TheaterType[] Theaters { get; private set; }
|
||||
|
||||
public bool IsTransformable { get; private set; }
|
||||
|
||||
public TemplateTypeFlag TemplateType { get; private set; }
|
||||
|
||||
public Size RenderSize { get; set; }
|
||||
|
||||
public Image Thumbnail { get; set; }
|
||||
|
||||
public TerrainType(sbyte id, string name, TheaterType[] theaters, bool[,] occupyMask, bool isTransformable, TemplateTypeFlag templateType)
|
||||
{
|
||||
ID = id;
|
||||
Name = name;
|
||||
Theaters = theaters;
|
||||
OccupyMask = occupyMask;
|
||||
IsTransformable = isTransformable;
|
||||
TemplateType = templateType;
|
||||
}
|
||||
|
||||
public TerrainType(sbyte id, string name, TheaterType[] theaters, bool[,] occupyMask, bool isTransformable)
|
||||
: this(id, name, theaters, occupyMask, isTransformable, TemplateTypeFlag.None)
|
||||
{
|
||||
}
|
||||
|
||||
public TerrainType(sbyte id, string name, TheaterType[] theaters, bool[,] occupyMask, TemplateTypeFlag templateType)
|
||||
: this(id, name, theaters, occupyMask, false, templateType)
|
||||
{
|
||||
}
|
||||
|
||||
public TerrainType(sbyte id, string name, TheaterType[] theaters, bool[,] occupyMask)
|
||||
: this(id, name, theaters, occupyMask, false, TemplateTypeFlag.None)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is TerrainType)
|
||||
{
|
||||
return this == obj;
|
||||
}
|
||||
else if (obj is sbyte)
|
||||
{
|
||||
return ID == (sbyte)obj;
|
||||
}
|
||||
else if (obj is string)
|
||||
{
|
||||
return string.Equals(Name, obj as string, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ID.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
public void Init(TheaterType theater)
|
||||
{
|
||||
string tileName = Name;
|
||||
if ((TemplateType & TemplateTypeFlag.OreMine) != TemplateTypeFlag.None)
|
||||
{
|
||||
tileName = "OREMINE";
|
||||
}
|
||||
|
||||
if (Globals.TheTilesetManager.GetTileData(theater.Tilesets, tileName, IsTransformable ? 22 : 0, out Tile tile))
|
||||
{
|
||||
RenderSize = new Size(tile.Image.Width / Globals.TileScale, tile.Image.Height / Globals.TileScale);
|
||||
Thumbnail = new Bitmap(tile.Image, tile.Image.Width / 2, tile.Image.Height / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class TheaterType
|
||||
{
|
||||
public sbyte ID { get; private set; }
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
public IEnumerable<string> Tilesets { get; private set; }
|
||||
|
||||
public TheaterType(sbyte id, string name, IEnumerable<string> tilesets)
|
||||
{
|
||||
ID = id;
|
||||
Name = name;
|
||||
Tilesets = tilesets;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is TheaterType)
|
||||
{
|
||||
return this == obj;
|
||||
}
|
||||
else if (obj is sbyte)
|
||||
{
|
||||
return ID == (sbyte)obj;
|
||||
}
|
||||
else if (obj is string)
|
||||
{
|
||||
return string.Equals(Name, obj as string, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ID.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,154 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using System;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public enum TriggerPersistantType
|
||||
{
|
||||
Volatile = 0,
|
||||
SemiPersistant = 1,
|
||||
Persistant = 2
|
||||
}
|
||||
|
||||
public enum TriggerMultiStyleType
|
||||
{
|
||||
Only = 0,
|
||||
And = 1,
|
||||
Or = 2,
|
||||
Linked = 3
|
||||
}
|
||||
|
||||
public class TriggerEvent : ICloneable
|
||||
{
|
||||
public static readonly string None = "None";
|
||||
|
||||
public string EventType { get; set; }
|
||||
|
||||
public string Team { get; set; }
|
||||
|
||||
public long Data { get; set; }
|
||||
|
||||
public TriggerEvent Clone()
|
||||
{
|
||||
return new TriggerEvent()
|
||||
{
|
||||
EventType = EventType,
|
||||
Team = Team,
|
||||
Data = Data
|
||||
};
|
||||
}
|
||||
|
||||
object ICloneable.Clone()
|
||||
{
|
||||
return Clone();
|
||||
}
|
||||
}
|
||||
|
||||
public class TriggerAction : ICloneable
|
||||
{
|
||||
public static readonly string None = "None";
|
||||
|
||||
public string ActionType { get; set; }
|
||||
|
||||
public string Trigger { get; set; }
|
||||
|
||||
public string Team { get; set; }
|
||||
|
||||
public long Data { get; set; }
|
||||
|
||||
public TriggerAction Clone()
|
||||
{
|
||||
return new TriggerAction()
|
||||
{
|
||||
ActionType = ActionType,
|
||||
Trigger = Trigger,
|
||||
Team = Team,
|
||||
Data = Data
|
||||
};
|
||||
}
|
||||
|
||||
object ICloneable.Clone()
|
||||
{
|
||||
return Clone();
|
||||
}
|
||||
}
|
||||
|
||||
public class Trigger : INamedType, ICloneable
|
||||
{
|
||||
public static readonly string None = "None";
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public TriggerPersistantType PersistantType { get; set; } = TriggerPersistantType.Volatile;
|
||||
|
||||
public string House { get; set; }
|
||||
|
||||
public TriggerMultiStyleType EventControl { get; set; } = TriggerMultiStyleType.Only;
|
||||
|
||||
public TriggerEvent Event1 { get; private set; } = new TriggerEvent { EventType = TriggerEvent.None };
|
||||
|
||||
public TriggerEvent Event2 { get; private set; } = new TriggerEvent { EventType = TriggerEvent.None };
|
||||
|
||||
public TriggerAction Action1 { get; private set; } = new TriggerAction { ActionType = TriggerEvent.None };
|
||||
|
||||
public TriggerAction Action2 { get; private set; } = new TriggerAction { ActionType = TriggerEvent.None };
|
||||
|
||||
public Trigger Clone()
|
||||
{
|
||||
return new Trigger()
|
||||
{
|
||||
Name = Name,
|
||||
PersistantType = PersistantType,
|
||||
House = House,
|
||||
EventControl = EventControl,
|
||||
Event1 = Event1.Clone(),
|
||||
Event2 = Event2.Clone(),
|
||||
Action1 = Action1.Clone(),
|
||||
Action2 = Action2.Clone()
|
||||
};
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is Trigger)
|
||||
{
|
||||
return this == obj;
|
||||
}
|
||||
else if (obj is string)
|
||||
{
|
||||
return string.Equals(Name, obj as string, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Name.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
object ICloneable.Clone()
|
||||
{
|
||||
return Clone();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class TypeItem<T>
|
||||
{
|
||||
public string Name { get; private set; }
|
||||
|
||||
public T Type { get; private set; }
|
||||
|
||||
public TypeItem(string name, T type)
|
||||
{
|
||||
Name = name;
|
||||
Type = type;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public class Unit : ICellOverlapper, ICellOccupier, INotifyPropertyChanged, ICloneable
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
private UnitType type;
|
||||
public UnitType Type { get => type; set => SetField(ref type, value); }
|
||||
|
||||
public Rectangle OverlapBounds => Type.OverlapBounds;
|
||||
|
||||
public bool[,] OccupyMask => Type.OccupyMask;
|
||||
|
||||
private HouseType house;
|
||||
public HouseType House { get => house; set => SetField(ref house, value); }
|
||||
|
||||
private int strength;
|
||||
public int Strength { get => strength; set => SetField(ref strength, value); }
|
||||
|
||||
private DirectionType direction;
|
||||
public DirectionType Direction { get => direction; set => SetField(ref direction, value); }
|
||||
|
||||
private string mission;
|
||||
public string Mission { get => mission; set => SetField(ref mission, value); }
|
||||
|
||||
private string trigger = Model.Trigger.None;
|
||||
public string Trigger { get => trigger; set => SetField(ref trigger, value); }
|
||||
|
||||
public Color Tint { get; set; } = Color.White;
|
||||
|
||||
public Unit Clone()
|
||||
{
|
||||
return new Unit()
|
||||
{
|
||||
Type = Type,
|
||||
House = House,
|
||||
Strength = Strength,
|
||||
Direction = Direction,
|
||||
Mission = Mission,
|
||||
Trigger = Trigger
|
||||
};
|
||||
}
|
||||
|
||||
protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
|
||||
{
|
||||
if (EqualityComparer<T>.Default.Equals(field, value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
field = value;
|
||||
OnPropertyChanged(propertyName);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
|
||||
object ICloneable.Clone()
|
||||
{
|
||||
return Clone();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,137 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Render;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public static class UnitTypeIDMask
|
||||
{
|
||||
public const sbyte Aircraft = 1 << 5;
|
||||
public const sbyte Vessel = 1 << 6;
|
||||
}
|
||||
|
||||
public class UnitType : ICellOverlapper, ICellOccupier, ITechnoType, IBrowsableType
|
||||
{
|
||||
public sbyte ID { get; private set; }
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
public string DisplayName { get; private set; }
|
||||
|
||||
public Rectangle OverlapBounds => new Rectangle(-1, -1, 3, 3);
|
||||
|
||||
public bool[,] OccupyMask => new bool[1, 1] { { true } };
|
||||
|
||||
public string OwnerHouse { get; private set; }
|
||||
|
||||
public bool HasTurret { get; private set; }
|
||||
|
||||
public bool IsFixedWing { get; private set; }
|
||||
|
||||
public bool IsUnit => !IsAircraft && !IsVessel;
|
||||
|
||||
public bool IsAircraft => (ID & UnitTypeIDMask.Aircraft) != 0;
|
||||
|
||||
public bool IsVessel => (ID & UnitTypeIDMask.Vessel) != 0;
|
||||
|
||||
public Size RenderSize { get; set; }
|
||||
|
||||
public Image Thumbnail { get; set; }
|
||||
|
||||
public UnitType(sbyte id, string name, string textId, string ownerHouse, bool hasTurret, bool isFixedWing)
|
||||
{
|
||||
ID = id;
|
||||
Name = name;
|
||||
DisplayName = Globals.TheGameTextManager[textId];
|
||||
OwnerHouse = ownerHouse;
|
||||
HasTurret = hasTurret;
|
||||
IsFixedWing = isFixedWing;
|
||||
}
|
||||
|
||||
public UnitType(sbyte id, string name, string textId, string ownerHouse, bool hasTurret)
|
||||
: this(id, name, textId, ownerHouse, hasTurret, false)
|
||||
{
|
||||
}
|
||||
|
||||
public UnitType(sbyte id, string name, string textId)
|
||||
: this(id, name, textId, null, false)
|
||||
{
|
||||
}
|
||||
|
||||
public UnitType(sbyte id, string name, string textId, string ownerHouse)
|
||||
: this(id, name, textId, ownerHouse, false)
|
||||
{
|
||||
}
|
||||
|
||||
public UnitType(sbyte id, string name, string textId, bool hasTurret)
|
||||
: this(id, name, textId, null, hasTurret)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is UnitType)
|
||||
{
|
||||
return this == obj;
|
||||
}
|
||||
else if (obj is sbyte)
|
||||
{
|
||||
return ID == (sbyte)obj;
|
||||
}
|
||||
else if (obj is string)
|
||||
{
|
||||
return string.Equals(Name, obj as string, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ID.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
public void Init(GameType gameType, TheaterType theater, HouseType house, DirectionType direction)
|
||||
{
|
||||
if (Globals.TheTilesetManager.GetTileData(theater.Tilesets, Name, 0, out Tile tile))
|
||||
{
|
||||
RenderSize = new Size(tile.Image.Width / Globals.TileScale, tile.Image.Height / Globals.TileScale);
|
||||
}
|
||||
|
||||
var mockUnit = new Unit()
|
||||
{
|
||||
Type = this,
|
||||
House = house,
|
||||
Strength = 256,
|
||||
Direction = direction
|
||||
};
|
||||
var unitThumbnail = new Bitmap(Globals.TileWidth * 3, Globals.TileHeight * 3);
|
||||
using (var g = Graphics.FromImage(unitThumbnail))
|
||||
{
|
||||
MapRenderer.Render(gameType, theater, new Point(1, 1), Globals.TileSize, mockUnit).Item2(g);
|
||||
}
|
||||
Thumbnail = unitThumbnail;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using System;
|
||||
|
||||
namespace MobiusEditor.Model
|
||||
{
|
||||
public enum WaypointFlag
|
||||
{
|
||||
None,
|
||||
PlayerStart
|
||||
}
|
||||
|
||||
public class Waypoint : INamedType
|
||||
{
|
||||
public string Name { get; private set; }
|
||||
|
||||
public WaypointFlag Flag { get; private set; }
|
||||
|
||||
public int? Cell { get; set; }
|
||||
|
||||
public Waypoint(string name, WaypointFlag flag)
|
||||
{
|
||||
Name = name;
|
||||
Flag = flag;
|
||||
}
|
||||
|
||||
public Waypoint(string name)
|
||||
: this(name, WaypointFlag.None)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is Waypoint)
|
||||
{
|
||||
return this == obj;
|
||||
}
|
||||
else if (obj is string)
|
||||
{
|
||||
return string.Equals(Name, obj as string, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Name.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Dialogs;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
// Change current culture to en-US
|
||||
if (Thread.CurrentThread.CurrentCulture.Name != "en-US")
|
||||
{
|
||||
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
|
||||
}
|
||||
|
||||
// Initialize megafiles
|
||||
var runPath = Environment.CurrentDirectory;
|
||||
Globals.TheMegafileManager = new MegafileManager(runPath);
|
||||
|
||||
var megafilesLoaded = true;
|
||||
var megafilePath = Path.Combine(runPath, "DATA");
|
||||
megafilesLoaded &= Globals.TheMegafileManager.Load(Path.Combine(megafilePath, "CONFIG.MEG"));
|
||||
megafilesLoaded &= Globals.TheMegafileManager.Load(Path.Combine(megafilePath, "TEXTURES_COMMON_SRGB.MEG"));
|
||||
megafilesLoaded &= Globals.TheMegafileManager.Load(Path.Combine(megafilePath, "TEXTURES_RA_SRGB.MEG"));
|
||||
megafilesLoaded &= Globals.TheMegafileManager.Load(Path.Combine(megafilePath, "TEXTURES_SRGB.MEG"));
|
||||
megafilesLoaded &= Globals.TheMegafileManager.Load(Path.Combine(megafilePath, "TEXTURES_TD_SRGB.MEG"));
|
||||
#if !DEVELOPER
|
||||
if (!megafilesLoaded)
|
||||
{
|
||||
MessageBox.Show("Required data is missing or corrupt, please validate your installation.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Initialize texture, tileset, team color, and game text managers
|
||||
Globals.TheTextureManager = new TextureManager(Globals.TheMegafileManager);
|
||||
Globals.TheTilesetManager = new TilesetManager(Globals.TheMegafileManager, Globals.TheTextureManager, Globals.TilesetsXMLPath, Globals.TexturesPath);
|
||||
Globals.TheTeamColorManager = new TeamColorManager(Globals.TheMegafileManager);
|
||||
|
||||
var cultureName = CultureInfo.CurrentUICulture.Name;
|
||||
var gameTextFilename = string.Format(Globals.GameTextFilenameFormat, cultureName.ToUpper());
|
||||
if (!Globals.TheMegafileManager.Exists(gameTextFilename))
|
||||
{
|
||||
gameTextFilename = string.Format(Globals.GameTextFilenameFormat, "EN-US");
|
||||
}
|
||||
Globals.TheGameTextManager = new GameTextManager(Globals.TheMegafileManager, gameTextFilename);
|
||||
|
||||
// Initialize Steam if this is a Steam build
|
||||
if (SteamworksUGC.IsSteamBuild)
|
||||
{
|
||||
if (!SteamworksUGC.Init())
|
||||
{
|
||||
#if !DEVELOPER
|
||||
MessageBox.Show("Unable to initialize Steam interface.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
if (Properties.Settings.Default.ShowInviteWarning)
|
||||
{
|
||||
var inviteMessageBox = new InviteMessageBox();
|
||||
inviteMessageBox.ShowDialog();
|
||||
|
||||
Properties.Settings.Default.ShowInviteWarning = !inviteMessageBox.DontShowAgain;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
Application.Run(new MainForm());
|
||||
|
||||
if (SteamworksUGC.IsSteamBuild)
|
||||
{
|
||||
SteamworksUGC.Shutdown();
|
||||
}
|
||||
|
||||
Globals.TheMegafileManager.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("CnC TDRA Map Editor")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Electronic Arts Inc.")]
|
||||
[assembly: AssemblyProduct("CnC TDRA Map Editor")]
|
||||
[assembly: AssemblyCopyright("© 2020 Electronic Arts Inc. All rights reserved.")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("397cef00-8930-4ec8-b15f-f7cf7193fb22")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,87 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MobiusEditor.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MobiusEditor.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap UI_CustomMissionPreviewDefault {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("UI_CustomMissionPreviewDefault", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue