Update for big April release, currently on PTR!

This commit is contained in:
GrapeshotGames 2019-04-05 18:19:41 -04:00
parent e866207ebd
commit 490a455cfd
82 changed files with 44286 additions and 6442 deletions

View file

@ -205,6 +205,8 @@ namespace AtlasGridDataLibrary
public float waterColorG = 0;
public float waterColorB = 0;
public int skyStyleIndex = 0;
[DefaultValue(1.0f)]
public float serverIslandPointsMultiplier = 1.0f;
[DefaultValue("")]
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public string ServerCustomDatas1 = "";
@ -283,6 +285,7 @@ namespace AtlasGridDataLibrary
public bool useNpcVolumesForTreasures = false;
public bool useLevelBoundsForTreasures = true;
public bool prioritizeVolumesForTreasures = false;
public int islandPoints = 1;
public string islandTreasureBottleSupplyCrateOverrides = "";
[DefaultValue(-1)]
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
@ -311,6 +314,9 @@ namespace AtlasGridDataLibrary
[DefaultValue("")]
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public string IslandInstanceClientCustomDatas2 = "";
public float islandWidth;
public float islandHeight;
}
public class DiscoveryZoneData : MoveableObjectData
{

View file

@ -68,6 +68,18 @@ namespace AtlasGridDataLibrary
[DefaultValue("")]
public string HttpAPIKey = "";
[DefaultValue("")]
public string S3URL = "";
[DefaultValue("")]
public string S3AccessKeyId = "";
[DefaultValue("")]
public string S3SecretKey = "";
[DefaultValue("")]
public string S3BucketName = "";
[DefaultValue("")]
public string S3KeyPrefix = "";
@ -77,6 +89,10 @@ namespace AtlasGridDataLibrary
MaxFileHistory = In.MaxFileHistory;
HttpBackupURL = In.HttpBackupURL;
HttpAPIKey = In.HttpAPIKey;
S3URL = In.S3URL;
S3AccessKeyId = In.S3AccessKeyId;
S3SecretKey = In.S3SecretKey;
S3BucketName = In.S3BucketName;
S3KeyPrefix = In.S3KeyPrefix;
}
}

View file

@ -41,6 +41,9 @@ namespace ServerGridEditor
[DefaultValue("")]
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
public string islandTreasureBottleSupplyCrateOverrides = "";
[DefaultValue(1)]
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
public int islandPoints;
[JsonIgnore]
public string modDir = null;
@ -93,7 +96,7 @@ namespace ServerGridEditor
public Island(string name, float x, float y, string imagePath, int landscapeMaterialOverride
, List<string> sublevelNames, Dictionary<string, string> spawnerOverrides, float minTreasureQuality, float maxTreasureQuality, bool useNpcVolumesForTreasures,
bool useLevelBoundsForTreasures, bool prioritizeVolumesForTreasures, string IslandTreasureBottleSupplyCrateOverrides, List<string> extraSublevels)
bool useLevelBoundsForTreasures, bool prioritizeVolumesForTreasures, string IslandTreasureBottleSupplyCrateOverrides, List<string> extraSublevels, int islandPoints)
{
this.name = name;
this.x = x;
@ -109,13 +112,14 @@ namespace ServerGridEditor
this.prioritizeVolumesForTreasures = prioritizeVolumesForTreasures;
this.islandTreasureBottleSupplyCrateOverrides = IslandTreasureBottleSupplyCrateOverrides;
this.extraSublevels = extraSublevels;
this.islandPoints = islandPoints;
}
}
public static class IslandInstanceEx
{
public static IslandInstanceData SetFrom(this IslandInstanceData Data, string name, float worldX, float worldY, float rotation, int id)
public static IslandInstanceData SetFrom(this IslandInstanceData Data, string name, float worldX, float worldY, float rotation, int id, float width, float height)
{
Data.name = name;
Data.worldX = worldX;
@ -135,6 +139,10 @@ namespace ServerGridEditor
Data.IslandInstanceClientCustomDatas1 = "";
Data.IslandInstanceClientCustomDatas2 = "";
Data.islandWidth = width;
Data.islandHeight = height;
Data.islandPoints = 1;
return Data;
}

View file

@ -30,7 +30,7 @@ namespace ServerGridEditor
bool isHomeServer, string AdditionalCmdLineParams, Dictionary<string, string> OverrideShooterGameModeDefaultGameIni, string name, int floorZDist, int transitionMinZ, int utcOffset, string OceanDinoDepthEntriesOverride,
string OceanFloatsamCratesOverride, string TreasureMapLootTablesOverride, DateTime lastModified, DateTime lastImageOverride, string GlobalBiomeSeamlessServerGridPreOffsetValues, string GlobalBiomeSeamlessServerGridPreOffsetValuesOceanWater,
bool islandLocked, bool discoLocked, bool pathsLocked, List<string> extraSublevels, string oceanEpicSpawnEntriesOverrideTemplateName, string NPCShipSpawnEntriesOverrideTemplateName, string regionOverrides,
float waterColorR, float waterColorG, float waterColorB, int skyStyleIndex, string ServerCustomDatas1, string ServerCustomDatas2, string ClientCustomDatas1, string ClientCustomDatas2, string serverTemplateName, string OceanEpicSpawnEntriesOverrideValues)
float waterColorR, float waterColorG, float waterColorB, int skyStyleIndex, float serverIslandPointsMultiplier, string ServerCustomDatas1, string ServerCustomDatas2, string ClientCustomDatas1, string ClientCustomDatas2, string serverTemplateName, string OceanEpicSpawnEntriesOverrideValues)
{
Data.gridX = gridX;
Data.gridY = gridY;
@ -56,6 +56,7 @@ namespace ServerGridEditor
Data.waterColorG = waterColorG;
Data.waterColorB = waterColorB;
Data.skyStyleIndex = skyStyleIndex;
Data.serverIslandPointsMultiplier = serverIslandPointsMultiplier;
Data.ServerCustomDatas1 = ServerCustomDatas1;
Data.ServerCustomDatas2 = ServerCustomDatas2;
Data.ClientCustomDatas1 = ClientCustomDatas1;
@ -84,7 +85,7 @@ namespace ServerGridEditor
bool isHomeServer, string AdditionalCmdLineParams, Dictionary<string, string> OverrideShooterGameModeDefaultGameIni, string name, int floorZDist, int transitionMinZ, int utcOffset, string OceanDinoDepthEntriesOverride,
string OceanFloatsamCratesOverride, string TreasureMapLootTablesOverride, DateTime lastModified, DateTime lastImageOverride, string GlobalBiomeSeamlessServerGridPreOffsetValues, string GlobalBiomeSeamlessServerGridPreOffsetValuesOceanWater,
bool islandLocked, bool discoLocked, bool pathsLocked, List<string> extraSublevels, string oceanEpicSpawnEntriesOverrideTemplateName, string NPCShipSpawnEntriesOverrideTemplateName, string regionOverrides,
float waterColorR, float waterColorG, float waterColorB, int skyStyleIndex, string ServerCustomDatas1, string ServerCustomDatas2, string ClientCustomDatas1, string ClientCustomDatas2, string serverTemplateName, string OceanEpicSpawnEntriesOverrideValues)
float waterColorR, float waterColorG, float waterColorB, int skyStyleIndex, float serverIslandPointsMultiplier, string ServerCustomDatas1, string ServerCustomDatas2, string ClientCustomDatas1, string ClientCustomDatas2, string serverTemplateName, string OceanEpicSpawnEntriesOverrideValues)
{
Data.gridX = gridX;
Data.gridY = gridY;
@ -112,6 +113,7 @@ namespace ServerGridEditor
Data.waterColorG = waterColorG;
Data.waterColorB = waterColorB;
Data.skyStyleIndex = skyStyleIndex;
Data.serverIslandPointsMultiplier = serverIslandPointsMultiplier;
Data.ServerCustomDatas1 = ServerCustomDatas1;
Data.ServerCustomDatas2 = ServerCustomDatas2;
Data.ClientCustomDatas1 = ClientCustomDatas1;
@ -147,6 +149,9 @@ namespace ServerGridEditor
//instance.spawnPointRegionOverride = referencedIsland.spawnPointRegionOverride;
instance.useLevelBoundsForTreasures = referencedIsland.useLevelBoundsForTreasures;
instance.prioritizeVolumesForTreasures = referencedIsland.prioritizeVolumesForTreasures;
instance.islandWidth = referencedIsland.x;
instance.islandHeight = referencedIsland.y;
instance.islandPoints = referencedIsland.islandPoints;
}
instance.SyncOverridesWithTemplates(mainForm);
@ -239,7 +244,7 @@ namespace ServerGridEditor
server.transitionMinZ, server.utcOffset, server.OceanDinoDepthEntriesOverride, server.oceanFloatsamCratesOverride,
server.treasureMapLootTablesOverride, server.lastModifiedUTC, server.lastImageOverrideUTC, server.GlobalBiomeSeamlessServerGridPreOffsetValues, server.GlobalBiomeSeamlessServerGridPreOffsetValuesOceanWater,
server.islandLocked, server.discoLocked, server.pathsLocked, server.extraSublevels, server.oceanEpicSpawnEntriesOverrideTemplateName, server.NPCShipSpawnEntriesOverrideTemplateName, server.regionOverrides,
server.waterColorR, server.waterColorG, server.waterColorB, server.skyStyleIndex, server.ServerCustomDatas1, server.ServerCustomDatas2, server.ClientCustomDatas1, server.ClientCustomDatas2, server.serverTemplateName, server.OceanEpicSpawnEntriesOverrideValues));
server.waterColorR, server.waterColorG, server.waterColorB, server.skyStyleIndex, server.serverIslandPointsMultiplier, server.ServerCustomDatas1, server.ServerCustomDatas2, server.ClientCustomDatas1, server.ClientCustomDatas2, server.serverTemplateName, server.OceanEpicSpawnEntriesOverrideValues));
}
else
{
@ -258,7 +263,7 @@ namespace ServerGridEditor
server.transitionMinZ, server.utcOffset, server.OceanDinoDepthEntriesOverride, server.oceanFloatsamCratesOverride,
server.treasureMapLootTablesOverride, server.lastModifiedUTC, server.lastImageOverrideUTC, server.GlobalBiomeSeamlessServerGridPreOffsetValues, server.GlobalBiomeSeamlessServerGridPreOffsetValuesOceanWater,
server.islandLocked, server.discoLocked, server.pathsLocked, overridenExtraSublevels, server.oceanEpicSpawnEntriesOverrideTemplateName, server.NPCShipSpawnEntriesOverrideTemplateName, server.regionOverrides,
server.waterColorR, server.waterColorG, server.waterColorB, server.skyStyleIndex, server.ServerCustomDatas1, server.ServerCustomDatas2, server.ClientCustomDatas1, server.ClientCustomDatas2, server.serverTemplateName, server.OceanEpicSpawnEntriesOverrideValues);
server.waterColorR, server.waterColorG, server.waterColorB, server.skyStyleIndex, server.serverIslandPointsMultiplier, server.ServerCustomDatas1, server.ServerCustomDatas2, server.ClientCustomDatas1, server.ClientCustomDatas2, server.serverTemplateName, server.OceanEpicSpawnEntriesOverrideValues);
//Apply template
if(!string.IsNullOrEmpty(server.serverTemplateName))
@ -275,6 +280,7 @@ namespace ServerGridEditor
exportServerObj.waterColorG = server.waterColorG != 0 ? server.waterColorG : serverTemplate.waterColorG;
exportServerObj.waterColorB = server.waterColorB != 0 ? server.waterColorB : serverTemplate.waterColorB;
exportServerObj.skyStyleIndex = server.skyStyleIndex != 0 ? server.skyStyleIndex : serverTemplate.skyStyleIndex;
exportServerObj.serverIslandPointsMultiplier = server.serverIslandPointsMultiplier != 1.0f ? server.serverIslandPointsMultiplier : serverTemplate.serverIslandPointsMultiplier;
exportServerObj.GlobalBiomeSeamlessServerGridPreOffsetValues = !string.IsNullOrEmpty(server.GlobalBiomeSeamlessServerGridPreOffsetValues) ? server.GlobalBiomeSeamlessServerGridPreOffsetValues : serverTemplate.GlobalBiomeSeamlessServerGridPreOffsetValues;
exportServerObj.GlobalBiomeSeamlessServerGridPreOffsetValuesOceanWater = !string.IsNullOrEmpty(server.GlobalBiomeSeamlessServerGridPreOffsetValuesOceanWater) ? server.GlobalBiomeSeamlessServerGridPreOffsetValuesOceanWater : serverTemplate.GlobalBiomeSeamlessServerGridPreOffsetValuesOceanWater;
exportServerObj.OceanDinoDepthEntriesOverride = !string.IsNullOrEmpty(server.OceanDinoDepthEntriesOverride) ? server.OceanDinoDepthEntriesOverride : serverTemplate.OceanDinoDepthEntriesOverride;
@ -572,6 +578,7 @@ namespace ServerGridEditor
s.waterColorG = deserializedServer.waterColorG;
s.waterColorB = deserializedServer.waterColorB;
s.skyStyleIndex = deserializedServer.skyStyleIndex;
s.serverIslandPointsMultiplier = deserializedServer.serverIslandPointsMultiplier;
s.ServerCustomDatas1 = deserializedServer.ServerCustomDatas1;
s.ServerCustomDatas2 = deserializedServer.ServerCustomDatas2;
s.ClientCustomDatas1 = deserializedServer.ClientCustomDatas1;
@ -613,6 +620,7 @@ namespace ServerGridEditor
deserializedIslandInstance.maxTreasureQuality = deserializedIslandInstance.minTreasureQuality = -1;
deserializedIslandInstance.useNpcVolumesForTreasures = false;
deserializedIslandInstance.islandTreasureBottleSupplyCrateOverrides = "";
deserializedIslandInstance.islandPoints = 1;
//deserializedIslandInstance.spawnPointRegionOverride = -1;
islandInstances.Add(deserializedIslandInstance);

View file

@ -39,6 +39,7 @@ namespace ServerGridEditor
public float waterColorG;
public float waterColorB;
public int skyStyleIndex;
public float serverIslandPointsMultiplier = 1.0f;
public string ServerCustomDatas1 = "";
public string ServerCustomDatas2 = "";
public string ClientCustomDatas1 = "";

View file

@ -64,6 +64,8 @@
this.instancesListBox = new System.Windows.Forms.ListBox();
this.label13 = new System.Windows.Forms.Label();
this.modNameTxtBox = new System.Windows.Forms.TextBox();
this.islandPointsTxtBox = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.spawnerOverridesGrid)).BeginInit();
this.SuspendLayout();
@ -285,7 +287,7 @@
// useNpcVolumesForTreasuresChkBox
//
this.useNpcVolumesForTreasuresChkBox.AutoSize = true;
this.useNpcVolumesForTreasuresChkBox.Location = new System.Drawing.Point(24, 391);
this.useNpcVolumesForTreasuresChkBox.Location = new System.Drawing.Point(24, 408);
this.useNpcVolumesForTreasuresChkBox.Name = "useNpcVolumesForTreasuresChkBox";
this.useNpcVolumesForTreasuresChkBox.Size = new System.Drawing.Size(174, 17);
this.useNpcVolumesForTreasuresChkBox.TabIndex = 23;
@ -297,7 +299,7 @@
this.useLevelBoundsForTreasuresChkBox.AutoSize = true;
this.useLevelBoundsForTreasuresChkBox.Checked = true;
this.useLevelBoundsForTreasuresChkBox.CheckState = System.Windows.Forms.CheckState.Checked;
this.useLevelBoundsForTreasuresChkBox.Location = new System.Drawing.Point(24, 453);
this.useLevelBoundsForTreasuresChkBox.Location = new System.Drawing.Point(24, 470);
this.useLevelBoundsForTreasuresChkBox.Name = "useLevelBoundsForTreasuresChkBox";
this.useLevelBoundsForTreasuresChkBox.Size = new System.Drawing.Size(169, 17);
this.useLevelBoundsForTreasuresChkBox.TabIndex = 24;
@ -307,7 +309,7 @@
// prioritizeVolumesForTreasuresChkBox
//
this.prioritizeVolumesForTreasuresChkBox.AutoSize = true;
this.prioritizeVolumesForTreasuresChkBox.Location = new System.Drawing.Point(24, 417);
this.prioritizeVolumesForTreasuresChkBox.Location = new System.Drawing.Point(24, 434);
this.prioritizeVolumesForTreasuresChkBox.Name = "prioritizeVolumesForTreasuresChkBox";
this.prioritizeVolumesForTreasuresChkBox.Size = new System.Drawing.Size(194, 30);
this.prioritizeVolumesForTreasuresChkBox.TabIndex = 25;
@ -352,7 +354,7 @@
//
this.label12.AutoSize = true;
this.label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label12.Location = new System.Drawing.Point(21, 485);
this.label12.Location = new System.Drawing.Point(21, 502);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(154, 13);
this.label12.TabIndex = 38;
@ -361,7 +363,7 @@
// instancesListBox
//
this.instancesListBox.FormattingEnabled = true;
this.instancesListBox.Location = new System.Drawing.Point(24, 502);
this.instancesListBox.Location = new System.Drawing.Point(24, 519);
this.instancesListBox.Name = "instancesListBox";
this.instancesListBox.Size = new System.Drawing.Size(194, 95);
this.instancesListBox.TabIndex = 39;
@ -382,6 +384,23 @@
this.modNameTxtBox.Size = new System.Drawing.Size(109, 20);
this.modNameTxtBox.TabIndex = 41;
//
// islandPointsTxtBox
//
this.islandPointsTxtBox.Location = new System.Drawing.Point(167, 382);
this.islandPointsTxtBox.Name = "islandPointsTxtBox";
this.islandPointsTxtBox.Size = new System.Drawing.Size(55, 20);
this.islandPointsTxtBox.TabIndex = 43;
this.islandPointsTxtBox.Text = "1";
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(26, 383);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(67, 13);
this.label14.TabIndex = 42;
this.label14.Text = "Island Points";
//
// CreateIslandForm
//
this.AcceptButton = this.createBtn;
@ -389,6 +408,8 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(609, 619);
this.Controls.Add(this.islandPointsTxtBox);
this.Controls.Add(this.label14);
this.Controls.Add(this.modNameTxtBox);
this.Controls.Add(this.label13);
this.Controls.Add(this.instancesListBox);
@ -475,5 +496,7 @@
private System.Windows.Forms.ListBox instancesListBox;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.TextBox modNameTxtBox;
private System.Windows.Forms.TextBox islandPointsTxtBox;
private System.Windows.Forms.Label label14;
}
}

View file

@ -63,6 +63,7 @@ namespace ServerGridEditor
prioritizeVolumesForTreasuresChkBox.Checked = editedIsland.prioritizeVolumesForTreasures;
IslandTreasureBottleSupplyCrateOverridesTxtBox.Text = editedIsland.islandTreasureBottleSupplyCrateOverrides;
islandPointsTxtBox.Text = editedIsland.islandPoints + "";
if (editedIsland.extraSublevels != null)
extraSublevelsTxtBox.Lines = editedIsland.extraSublevels.ToArray();
@ -171,6 +172,8 @@ namespace ServerGridEditor
float.TryParse(minTreasureQualityTxtBox.Text, out minTreasureQuality);
float.TryParse(maxTreasureQualityTxtBox.Text, out maxTreasureQuality);
int islandPoints = 1;
int.TryParse(islandPointsTxtBox.Text, out islandPoints);
string islandRemovedFromMod = null;
if (editedIsland != null)
{
@ -296,6 +299,7 @@ namespace ServerGridEditor
editedIsland.islandTreasureBottleSupplyCrateOverrides = IslandTreasureBottleSupplyCrateOverridesTxtBox.Text;
editedIsland.islandPoints = islandPoints;
List<string> NewEntries = new List<string>(extraSublevelsTxtBox.Lines);
NewEntries.RemoveAll(item => { return string.IsNullOrWhiteSpace(item); });
editedIsland.extraSublevels = NewEntries;
@ -347,7 +351,7 @@ namespace ServerGridEditor
mainForm.islands.Add(Name, new Island(Name, x, y, newImgPath, landscapeMaterialOverride, sublevelNames, spawnerOverrides,
minTreasureQuality, maxTreasureQuality, useNpcVolumesForTreasuresChkBox.Checked, useLevelBoundsForTreasuresChkBox.Checked,
prioritizeVolumesForTreasuresChkBox.Checked, IslandTreasureBottleSupplyCrateOverridesTxtBox.Text, new List<string>(extraSublevelsTxtBox.Lines)));
prioritizeVolumesForTreasuresChkBox.Checked, IslandTreasureBottleSupplyCrateOverridesTxtBox.Text, new List<string>(extraSublevelsTxtBox.Lines), islandPoints));
mainForm.islands.Last().Value.modDir = modNameTxtBox.Text.Trim();

View file

@ -95,6 +95,8 @@
this.templateComboBox = new System.Windows.Forms.ComboBox();
this.OceanEpicSpawnEntriesOverrideValuesTxtBox = new System.Windows.Forms.TextBox();
this.label31 = new System.Windows.Forms.Label();
this.label32 = new System.Windows.Forms.Label();
this.serverIslandPointsMultiplierTxtBox = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.overrideShooterGameModeDefaultGameIniDataGridView)).BeginInit();
this.SuspendLayout();
//
@ -134,7 +136,7 @@
//
// saveBtn
//
this.saveBtn.Location = new System.Drawing.Point(7, 679);
this.saveBtn.Location = new System.Drawing.Point(7, 712);
this.saveBtn.Name = "saveBtn";
this.saveBtn.Size = new System.Drawing.Size(94, 32);
this.saveBtn.TabIndex = 9;
@ -152,7 +154,7 @@
// cancelBtn
//
this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelBtn.Location = new System.Drawing.Point(107, 679);
this.cancelBtn.Location = new System.Drawing.Point(107, 712);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(96, 32);
this.cancelBtn.TabIndex = 10;
@ -172,7 +174,7 @@
// homeServerCheckbox
//
this.homeServerCheckbox.AutoSize = true;
this.homeServerCheckbox.Location = new System.Drawing.Point(19, 650);
this.homeServerCheckbox.Location = new System.Drawing.Point(19, 683);
this.homeServerCheckbox.Name = "homeServerCheckbox";
this.homeServerCheckbox.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.homeServerCheckbox.Size = new System.Drawing.Size(88, 17);
@ -182,7 +184,7 @@
//
// runTestsBtn
//
this.runTestsBtn.Location = new System.Drawing.Point(243, 679);
this.runTestsBtn.Location = new System.Drawing.Point(243, 712);
this.runTestsBtn.Name = "runTestsBtn";
this.runTestsBtn.Size = new System.Drawing.Size(96, 32);
this.runTestsBtn.TabIndex = 15;
@ -376,7 +378,7 @@
//
// editSpawnRegions
//
this.editSpawnRegions.Location = new System.Drawing.Point(225, 641);
this.editSpawnRegions.Location = new System.Drawing.Point(225, 674);
this.editSpawnRegions.Name = "editSpawnRegions";
this.editSpawnRegions.Size = new System.Drawing.Size(114, 32);
this.editSpawnRegions.TabIndex = 42;
@ -567,7 +569,7 @@
//
// ServerCustomDatas1TxtBox
//
this.ServerCustomDatas1TxtBox.Location = new System.Drawing.Point(122, 531);
this.ServerCustomDatas1TxtBox.Location = new System.Drawing.Point(122, 564);
this.ServerCustomDatas1TxtBox.Name = "ServerCustomDatas1TxtBox";
this.ServerCustomDatas1TxtBox.Size = new System.Drawing.Size(230, 20);
this.ServerCustomDatas1TxtBox.TabIndex = 88;
@ -575,7 +577,7 @@
// label25
//
this.label25.AutoSize = true;
this.label25.Location = new System.Drawing.Point(13, 534);
this.label25.Location = new System.Drawing.Point(13, 567);
this.label25.Name = "label25";
this.label25.Size = new System.Drawing.Size(110, 13);
this.label25.TabIndex = 87;
@ -583,7 +585,7 @@
//
// ServerCustomDatas2TxtBox
//
this.ServerCustomDatas2TxtBox.Location = new System.Drawing.Point(122, 554);
this.ServerCustomDatas2TxtBox.Location = new System.Drawing.Point(122, 587);
this.ServerCustomDatas2TxtBox.Name = "ServerCustomDatas2TxtBox";
this.ServerCustomDatas2TxtBox.Size = new System.Drawing.Size(230, 20);
this.ServerCustomDatas2TxtBox.TabIndex = 90;
@ -591,7 +593,7 @@
// label26
//
this.label26.AutoSize = true;
this.label26.Location = new System.Drawing.Point(13, 557);
this.label26.Location = new System.Drawing.Point(13, 590);
this.label26.Name = "label26";
this.label26.Size = new System.Drawing.Size(110, 13);
this.label26.TabIndex = 89;
@ -599,7 +601,7 @@
//
// ClientCustomDatas2TxtBox
//
this.ClientCustomDatas2TxtBox.Location = new System.Drawing.Point(122, 603);
this.ClientCustomDatas2TxtBox.Location = new System.Drawing.Point(122, 636);
this.ClientCustomDatas2TxtBox.Name = "ClientCustomDatas2TxtBox";
this.ClientCustomDatas2TxtBox.Size = new System.Drawing.Size(230, 20);
this.ClientCustomDatas2TxtBox.TabIndex = 94;
@ -607,7 +609,7 @@
// label27
//
this.label27.AutoSize = true;
this.label27.Location = new System.Drawing.Point(13, 606);
this.label27.Location = new System.Drawing.Point(13, 639);
this.label27.Name = "label27";
this.label27.Size = new System.Drawing.Size(105, 13);
this.label27.TabIndex = 93;
@ -615,7 +617,7 @@
//
// ClientCustomDatas1TxtBox
//
this.ClientCustomDatas1TxtBox.Location = new System.Drawing.Point(122, 580);
this.ClientCustomDatas1TxtBox.Location = new System.Drawing.Point(122, 613);
this.ClientCustomDatas1TxtBox.Name = "ClientCustomDatas1TxtBox";
this.ClientCustomDatas1TxtBox.Size = new System.Drawing.Size(230, 20);
this.ClientCustomDatas1TxtBox.TabIndex = 92;
@ -623,7 +625,7 @@
// label28
//
this.label28.AutoSize = true;
this.label28.Location = new System.Drawing.Point(13, 583);
this.label28.Location = new System.Drawing.Point(13, 616);
this.label28.Name = "label28";
this.label28.Size = new System.Drawing.Size(105, 13);
this.label28.TabIndex = 91;
@ -666,6 +668,23 @@
this.label31.TabIndex = 97;
this.label31.Text = "OceanEpicSpawnEntriesOverrideValues";
//
// label32
//
this.label32.AutoSize = true;
this.label32.Location = new System.Drawing.Point(132, 525);
this.label32.Name = "label32";
this.label32.Size = new System.Drawing.Size(137, 13);
this.label32.TabIndex = 100;
this.label32.Text = "serverIslandPointsMultiplier:";
//
// serverIslandPointsMultiplierTxtBox
//
this.serverIslandPointsMultiplierTxtBox.Location = new System.Drawing.Point(275, 522);
this.serverIslandPointsMultiplierTxtBox.Name = "serverIslandPointsMultiplierTxtBox";
this.serverIslandPointsMultiplierTxtBox.Size = new System.Drawing.Size(79, 20);
this.serverIslandPointsMultiplierTxtBox.TabIndex = 99;
this.serverIslandPointsMultiplierTxtBox.TextChanged += new System.EventHandler(this.textBox1_TextChanged_1);
//
// EditServerForm
//
this.AcceptButton = this.saveBtn;
@ -673,6 +692,8 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(667, 762);
this.Controls.Add(this.label32);
this.Controls.Add(this.serverIslandPointsMultiplierTxtBox);
this.Controls.Add(this.OceanEpicSpawnEntriesOverrideValuesTxtBox);
this.Controls.Add(this.label31);
this.Controls.Add(this.templateComboBox);
@ -822,5 +843,7 @@
private System.Windows.Forms.ComboBox templateComboBox;
private System.Windows.Forms.TextBox OceanEpicSpawnEntriesOverrideValuesTxtBox;
private System.Windows.Forms.Label label31;
private System.Windows.Forms.Label label32;
private System.Windows.Forms.TextBox serverIslandPointsMultiplierTxtBox;
}
}

View file

@ -42,6 +42,7 @@ namespace ServerGridEditor
waterColorGTxtBox.Text = targetServer.waterColorG.ToString();
waterColorBTxtBox.Text = targetServer.waterColorB.ToString();
skyStyleIndexTxtBox.Text = targetServer.skyStyleIndex.ToString();
serverIslandPointsMultiplierTxtBox.Text = targetServer.serverIslandPointsMultiplier.ToString();
ServerCustomDatas1TxtBox.Text = targetServer.ServerCustomDatas1;
ServerCustomDatas2TxtBox.Text = targetServer.ServerCustomDatas2;
ClientCustomDatas1TxtBox.Text = targetServer.ClientCustomDatas1;
@ -133,6 +134,7 @@ namespace ServerGridEditor
float waterColorR, waterColorG, waterColorB;
int skyStyleIndex;
float serverIslandPointsMultiplier;
if (!float.TryParse(waterColorRTxtBox.Text, out waterColorR))
{
@ -154,6 +156,11 @@ namespace ServerGridEditor
MessageBox.Show("Invalid number for skyStyleIndex", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
if (!float.TryParse(serverIslandPointsMultiplierTxtBox.Text, out serverIslandPointsMultiplier))
{
MessageBox.Show("Invalid number for serverIslandPointsMultiplier", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
targetServer.name = nameTxtBox.Text;
@ -171,6 +178,7 @@ namespace ServerGridEditor
targetServer.waterColorG = waterColorG;
targetServer.waterColorB = waterColorB;
targetServer.skyStyleIndex = skyStyleIndex;
targetServer.serverIslandPointsMultiplier = serverIslandPointsMultiplier;
targetServer.ServerCustomDatas1 = ServerCustomDatas1TxtBox.Text;
targetServer.ServerCustomDatas2 = ServerCustomDatas2TxtBox.Text;
targetServer.ClientCustomDatas1 = ClientCustomDatas1TxtBox.Text;
@ -265,5 +273,10 @@ namespace ServerGridEditor
e.DrawFocusRectangle();
}
private void textBox1_TextChanged_1(object sender, EventArgs e)
{
}
}
}

View file

@ -85,6 +85,8 @@
this.label33 = new System.Windows.Forms.Label();
this.OceanEpicSpawnEntriesOverrideValuesTxtBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.serverIslandPointsMultiplierTxtBox = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.overrideShooterGameModeDefaultGameIniDataGridView)).BeginInit();
this.SuspendLayout();
//
@ -425,7 +427,7 @@
//
// ServerCustomDatas1TxtBox
//
this.ServerCustomDatas1TxtBox.Location = new System.Drawing.Point(121, 478);
this.ServerCustomDatas1TxtBox.Location = new System.Drawing.Point(123, 507);
this.ServerCustomDatas1TxtBox.Name = "ServerCustomDatas1TxtBox";
this.ServerCustomDatas1TxtBox.Size = new System.Drawing.Size(230, 20);
this.ServerCustomDatas1TxtBox.TabIndex = 88;
@ -433,7 +435,7 @@
// label25
//
this.label25.AutoSize = true;
this.label25.Location = new System.Drawing.Point(12, 481);
this.label25.Location = new System.Drawing.Point(14, 510);
this.label25.Name = "label25";
this.label25.Size = new System.Drawing.Size(110, 13);
this.label25.TabIndex = 87;
@ -441,7 +443,7 @@
//
// ServerCustomDatas2TxtBox
//
this.ServerCustomDatas2TxtBox.Location = new System.Drawing.Point(121, 501);
this.ServerCustomDatas2TxtBox.Location = new System.Drawing.Point(123, 530);
this.ServerCustomDatas2TxtBox.Name = "ServerCustomDatas2TxtBox";
this.ServerCustomDatas2TxtBox.Size = new System.Drawing.Size(230, 20);
this.ServerCustomDatas2TxtBox.TabIndex = 90;
@ -449,7 +451,7 @@
// label26
//
this.label26.AutoSize = true;
this.label26.Location = new System.Drawing.Point(12, 504);
this.label26.Location = new System.Drawing.Point(14, 533);
this.label26.Name = "label26";
this.label26.Size = new System.Drawing.Size(110, 13);
this.label26.TabIndex = 89;
@ -457,7 +459,7 @@
//
// ClientCustomDatas2TxtBox
//
this.ClientCustomDatas2TxtBox.Location = new System.Drawing.Point(121, 550);
this.ClientCustomDatas2TxtBox.Location = new System.Drawing.Point(123, 579);
this.ClientCustomDatas2TxtBox.Name = "ClientCustomDatas2TxtBox";
this.ClientCustomDatas2TxtBox.Size = new System.Drawing.Size(230, 20);
this.ClientCustomDatas2TxtBox.TabIndex = 94;
@ -465,7 +467,7 @@
// label27
//
this.label27.AutoSize = true;
this.label27.Location = new System.Drawing.Point(12, 553);
this.label27.Location = new System.Drawing.Point(14, 582);
this.label27.Name = "label27";
this.label27.Size = new System.Drawing.Size(105, 13);
this.label27.TabIndex = 93;
@ -473,7 +475,7 @@
//
// ClientCustomDatas1TxtBox
//
this.ClientCustomDatas1TxtBox.Location = new System.Drawing.Point(121, 527);
this.ClientCustomDatas1TxtBox.Location = new System.Drawing.Point(123, 556);
this.ClientCustomDatas1TxtBox.Name = "ClientCustomDatas1TxtBox";
this.ClientCustomDatas1TxtBox.Size = new System.Drawing.Size(230, 20);
this.ClientCustomDatas1TxtBox.TabIndex = 92;
@ -481,7 +483,7 @@
// label28
//
this.label28.AutoSize = true;
this.label28.Location = new System.Drawing.Point(12, 530);
this.label28.Location = new System.Drawing.Point(14, 559);
this.label28.Name = "label28";
this.label28.Size = new System.Drawing.Size(105, 13);
this.label28.TabIndex = 91;
@ -564,6 +566,22 @@
this.label1.TabIndex = 102;
this.label1.Text = "OceanEpicSpawnEntriesOverrideValues";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(131, 475);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(137, 13);
this.label2.TabIndex = 105;
this.label2.Text = "serverIslandPointsMultiplier:";
//
// serverIslandPointsMultiplierTxtBox
//
this.serverIslandPointsMultiplierTxtBox.Location = new System.Drawing.Point(274, 472);
this.serverIslandPointsMultiplierTxtBox.Name = "serverIslandPointsMultiplierTxtBox";
this.serverIslandPointsMultiplierTxtBox.Size = new System.Drawing.Size(79, 20);
this.serverIslandPointsMultiplierTxtBox.TabIndex = 104;
//
// EditServerTemplate
//
this.AcceptButton = this.saveBtn;
@ -571,6 +589,8 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(667, 770);
this.Controls.Add(this.label2);
this.Controls.Add(this.serverIslandPointsMultiplierTxtBox);
this.Controls.Add(this.OceanEpicSpawnEntriesOverrideValuesTxtBox);
this.Controls.Add(this.label1);
this.Controls.Add(this.label30);
@ -700,5 +720,7 @@
private System.Windows.Forms.Label label33;
private System.Windows.Forms.TextBox OceanEpicSpawnEntriesOverrideValuesTxtBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox serverIslandPointsMultiplierTxtBox;
}
}

View file

@ -36,6 +36,7 @@ namespace ServerGridEditor
waterColorGTxtBox.Text = targetServerTemplate.waterColorG.ToString();
waterColorBTxtBox.Text = targetServerTemplate.waterColorB.ToString();
skyStyleIndexTxtBox.Text = targetServerTemplate.skyStyleIndex.ToString();
serverIslandPointsMultiplierTxtBox.Text = targetServerTemplate.serverIslandPointsMultiplier.ToString();
ServerCustomDatas1TxtBox.Text = targetServerTemplate.ServerCustomDatas1;
ServerCustomDatas2TxtBox.Text = targetServerTemplate.ServerCustomDatas2;
ClientCustomDatas1TxtBox.Text = targetServerTemplate.ClientCustomDatas1;
@ -127,6 +128,7 @@ namespace ServerGridEditor
float waterColorR, waterColorG, waterColorB;
float templateColorR, templateColorG, templateColorB;
int skyStyleIndex;
float serverIslandPointsMultiplier;
if (!float.TryParse(waterColorRTxtBox.Text, out waterColorR))
{
@ -150,6 +152,13 @@ namespace ServerGridEditor
return false;
}
if (!float.TryParse(serverIslandPointsMultiplierTxtBox.Text, out serverIslandPointsMultiplier))
{
MessageBox.Show("Invalid number for serverIslandPointsMultiplier", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
if (!float.TryParse(templateColRTxtBox.Text, out templateColorR))
{
@ -177,6 +186,7 @@ namespace ServerGridEditor
targetServerTemplate.waterColorG = waterColorG;
targetServerTemplate.waterColorB = waterColorB;
targetServerTemplate.skyStyleIndex = skyStyleIndex;
targetServerTemplate.serverIslandPointsMultiplier = serverIslandPointsMultiplier;
targetServerTemplate.ServerCustomDatas1 = ServerCustomDatas1TxtBox.Text;
targetServerTemplate.ServerCustomDatas2 = ServerCustomDatas2TxtBox.Text;
targetServerTemplate.ClientCustomDatas1 = ClientCustomDatas1TxtBox.Text;

View file

@ -88,6 +88,7 @@ namespace ServerGridEditor
public MainForm()
{
//DoubleBuffered = true;
InitializeComponent();
@ -467,39 +468,38 @@ namespace ServerGridEditor
if (drawRect.Height < 0)
drawRect.Height *= -1;
bool culled = true;
if (!cull || canvasRect.IntersectsWith(drawRect))
{
drawRect.X = -drawRect.Width / 2;
drawRect.Y = -drawRect.Height / 2;
g.DrawImage(currentProject.DiscoveryZoneImage, drawRect);
culled = false;
}
g.RotateTransform(-discoInst.rotation);
g.TranslateTransform(-discoInst.worldX * currentProject.coordsScaling, -discoInst.worldY * currentProject.coordsScaling);
}
//Draw discoZone info
// if (showDiscoZoneInfo)
{
foreach (DiscoveryZoneData zoneInst in currentProject.discoZones)
if(!culled)
{
float zoneSize = Math.Max(zoneInst.sizeX * currentProject.coordsScaling, 0.00001f);
float zoneSize = Math.Max(discoInst.sizeX * currentProject.coordsScaling, 0.00001f);
Font font = new Font(SystemFonts.DefaultFont.FontFamily, DefaultFont.SizeInPoints * zoneSize / 200, FontStyle.Regular);
SizeF stringSize = g.MeasureString("T", font);
float dynamicOutlineShift = stringSize.Height * outlineShift;
PointF zoneCenter = new PointF(zoneInst.worldX, zoneInst.worldY);
PointF zoneCenter = new PointF(discoInst.worldX, discoInst.worldY);
zoneCenter = new PointF(zoneCenter.X * currentProject.coordsScaling, zoneCenter.Y * currentProject.coordsScaling);
if (cull)
{
RectangleF drawRect = new RectangleF(zoneCenter.X - stringSize.Width / 2, zoneCenter.Y - stringSize.Width / 2, stringSize.Width, 3.3f * stringSize.Height);
if (RectangleF.Intersect(canvasRect, drawRect).IsEmpty)
continue;
}
//if (cull)
//{
// RectangleF drawRect = new RectangleF(zoneCenter.X - stringSize.Width / 2, zoneCenter.Y - stringSize.Width / 2, stringSize.Width, 3.3f * stringSize.Height);
// if (canvasRect.IntersectsWith(drawRect))
// continue;
//}
g.DrawString("name: " + zoneInst.name, font, Brushes.Black, new PointF(zoneCenter.X + dynamicOutlineShift, zoneCenter.Y + dynamicOutlineShift), centeredStringFormat);
g.DrawString("name: " + discoInst.name, font, Brushes.Black, new PointF(zoneCenter.X + dynamicOutlineShift, zoneCenter.Y + dynamicOutlineShift), centeredStringFormat);
zoneCenter.Y += stringSize.Height * 1.1f;
g.DrawString("xp: " + zoneInst.xp, font, Brushes.White, zoneCenter, centeredStringFormat);
g.DrawString("xp: " + discoInst.xp, font, Brushes.White, zoneCenter, centeredStringFormat);
}
}
}
@ -718,6 +718,25 @@ namespace ServerGridEditor
g.DrawBeziers(p, bezierPoints.ToArray());
}
}
if(mainForm.makingSelectionBox || mainForm.selectedMovableObjects.Count > 0)
{
Pen pen = new Pen(Color.Black, 2.5f);
pen.DashStyle = DashStyle.Dash;
RectangleF selBox = mainForm.selectionBox;
//RectangleF selBox = new RectangleF(selBoxRef.Location, selBoxRef.Size);
selBox.X *= currentProject.coordsScaling;
selBox.Y *= currentProject.coordsScaling;
selBox.Width *= currentProject.coordsScaling;
selBox.Height *= currentProject.coordsScaling;
g.TranslateTransform(selBox.X + selBox.Width / 2, selBox.Y + selBox.Height / 2);
g.RotateTransform(mainForm.selectionBoxRotation, System.Drawing.Drawing2D.MatrixOrder.Prepend);
g.TranslateTransform(-selBox.Width / 2, -selBox.Height / 2);
g.DrawRectangle(pen, 0, 0, selBox.Width, selBox.Height);
//g.RotateTransform(-mainForm.selectionBoxRotation, System.Drawing.Drawing2D.MatrixOrder.Prepend);
//g.TranslateTransform(-selBox.Y - selBox.Width / 2, -selBox.Y - selBox.Height / 2);
}
}
private void mapPanel_DragDrop(object sender, DragEventArgs e)
@ -730,7 +749,17 @@ namespace ServerGridEditor
p = GetTarnsformedMapPoint(p);
PointF worldPoint = MapToUnrealPoint(p);
int id = currentProject.GenerateNewId();
currentProject.islandInstances.Add(new IslandInstanceData().SetFrom((string)e.Data.GetData("".GetType()), worldPoint.X, worldPoint.Y, 0, id));
float width = 0, height = 0;
string name = (string)e.Data.GetData("".GetType());
if (islands.ContainsKey(name))
{
Island island = islands[name];
width = island.x;
height = island.y;
}
currentProject.islandInstances.Add(new IslandInstanceData().SetFrom(name, worldPoint.X, worldPoint.Y, 0, id, width, height));
currentProject.islandInstances.Last().SetDirty(this);
islandListBox.Invalidate();
mapPanel.Invalidate();
@ -747,7 +776,15 @@ namespace ServerGridEditor
Point moveDelta = new Point(e.Location.X - previousMousePos.X, e.Location.Y - previousMousePos.Y);
if (CurrentHeldMoveableObject != null)
if(makingSelectionBox)
{
PointF p = MapToUnrealPoint(GetTarnsformedMapPoint(e.Location));
selectionBox.Width = p.X - selectionBox.X;
selectionBox.Height = p.Y - selectionBox.Y;
mapPanel.Invalidate();
}
else if (CurrentHeldMoveableObject != null)
{
if (CurrentHeldMoveableObject is DiscoveryZoneData && bResizingDiscoZone)
{
@ -809,6 +846,72 @@ namespace ServerGridEditor
this.Cursor = Cursor.Current = Cursors.NoMove2D;
mapPanel.Invalidate();
}
else if (selectedMovableObjects.Count > 0)
{
if (selectionBoxHeld)
{
selectionBox.X += moveDelta.X / currentProject.coordsScaling;
selectionBox.Y += moveDelta.Y / currentProject.coordsScaling;
for (int i = 0; i < selectedMovableObjects.Count; i++)
selectedMovableObjects[i].SetWorldLocation(
this,
new PointF(selectedMovableObjects[i].worldX + moveDelta.X / currentProject.coordsScaling,
selectedMovableObjects[i].worldY + moveDelta.Y / currentProject.coordsScaling)
);
this.Cursor = Cursor.Current = Cursors.SizeAll;
mapPanel.Invalidate();
}
else if(selectionBoxRotated)
{
PointF selectionCenter = selectionBox.Location;
selectionCenter.X += selectionBox.Width / 2;
selectionCenter.Y += selectionBox.Height / 2;
float angleToCenter = StaticHelpers.GetAngleOfPoint(new Point((int)(selectionCenter.X * currentProject.coordsScaling), (int)(selectionCenter.Y * currentProject.coordsScaling)), GetTarnsformedMapPoint(e.Location));
if (startRotation.HasValue)
{
float lastFrameRotation = angleToCenter - startRotation.Value;
for (int i = 0; i < selectedMovableObjects.Count; i++)
{
selectedMovableObjects[i].rotation += angleToCenter - startRotation.Value;
PointF MovableLoc = new PointF(selectedMovableObjects[i].worldX, selectedMovableObjects[i].worldY);
MovableLoc = StaticHelpers.RotatePointAround(MovableLoc, selectionCenter, lastFrameRotation);
selectedMovableObjects[i].SetWorldLocation(this, MovableLoc);
}
selectionBoxRotation += lastFrameRotation;
startRotation = angleToCenter;
}
else
{
startRotation = angleToCenter;
}
this.Cursor = Cursor.Current = Cursors.UpArrow;
mapPanel.Invalidate();
}
else
{
Point p = e.Location;
p = GetTarnsformedMapPoint(p);
PointF worldPoint = MapToUnrealPoint(p);
PointF selectionCenter = selectionBox.Location;
selectionCenter.X += selectionBox.Width / 2;
selectionCenter.Y += selectionBox.Height / 2;
worldPoint = StaticHelpers.RotatePointAround(worldPoint, selectionCenter, -selectionBoxRotation);
if (selectionBox.Contains(worldPoint))
this.Cursor = Cursor.Current = Cursors.Hand;
else
this.Cursor = Cursor.Current = Cursors.Default;
}
}
else
{
if (mapPanel.Visible && GetFirstMoveableObjectAtLocation(GetTarnsformedMapPoint(e.Location)) != null)
@ -827,10 +930,44 @@ namespace ServerGridEditor
}
Point middlePressLocation;
RectangleF selectionBox;
bool makingSelectionBox = false;
bool selectionBoxHeld = false;
bool selectionBoxRotated = false;
float selectionBoxRotation = 0;
List<MoveableObjectData> selectedMovableObjects = new List<MoveableObjectData>();
private void mapPanel_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
if (selectedMovableObjects.Count > 0)
{
Point p = e.Location;
p = GetTarnsformedMapPoint(p);
PointF worldPoint = MapToUnrealPoint(p);
PointF selectionCenter = selectionBox.Location;
selectionCenter.X += selectionBox.Width / 2;
selectionCenter.Y += selectionBox.Height / 2;
worldPoint = StaticHelpers.RotatePointAround(worldPoint, selectionCenter, -selectionBoxRotation);
if (selectionBox.Contains(worldPoint))
{
selectionBoxHeld = true;
}
else
{
makingSelectionBox = true;
selectionBox.Location = MapToUnrealPoint(GetTarnsformedMapPoint(e.Location));
selectionBox.Width = 0;
selectionBox.Height = 0;
selectionBoxRotation = 0;
}
return;
}
if (ModifierKeys == Keys.Control)
{
IslandInstanceData IslandInst = GetFirstInstanceAtLocation(GetTarnsformedMapPoint(e.Location));
@ -899,10 +1036,34 @@ namespace ServerGridEditor
CurrentHeldMoveableObject = GetFirstMoveableObjectAtLocation(GetTarnsformedMapPoint(e.Location));
if (CurrentHeldMoveableObject != null)
CurrentHeldMoveableObject.SetDirty(this);
else
{
makingSelectionBox = true;
selectionBox.Location = MapToUnrealPoint(GetTarnsformedMapPoint(e.Location));
selectionBox.Width = 0;
selectionBox.Height = 0;
selectionBoxRotation = 0;
}
}
}
else if (e.Button == MouseButtons.Right)
{
if (selectedMovableObjects.Count > 0)
{
Point p = e.Location;
p = GetTarnsformedMapPoint(p);
PointF worldPoint = MapToUnrealPoint(p);
PointF selectionCenter = selectionBox.Location;
selectionCenter.X += selectionBox.Width / 2;
selectionCenter.Y += selectionBox.Height / 2;
worldPoint = StaticHelpers.RotatePointAround(worldPoint, selectionCenter, -selectionBoxRotation);
if (selectionBox.Contains(worldPoint))
selectionBoxRotated = true;
return;
}
Server s = GetServerAtPoint(GetTarnsformedMapPoint(e.Location));
if (ModifierKeys == Keys.Control)
{
@ -1050,12 +1211,39 @@ namespace ServerGridEditor
CurrentHeldMoveableObject.SetDirty(this);
CurrentHeldMoveableObject = null;
}
else if(makingSelectionBox)
{
selectedMovableObjects.Clear();
makingSelectionBox = false;
foreach (IslandInstanceData instance in currentProject.islandInstances)
{
if (selectionBox.Contains(new PointF(instance.worldX, instance.worldY)))
selectedMovableObjects.Add(instance);
}
foreach (DiscoveryZoneData instance in currentProject.discoZones)
{
if (selectionBox.Contains(new PointF(instance.worldX, instance.worldY)))
selectedMovableObjects.Add(instance);
}
mapPanel.Invalidate();
}
else if(selectionBoxHeld)
{
selectionBoxHeld = false;
}
}
else if (e.Button == MouseButtons.Right)
{
CurrentRotatedMoveableObject = null;
if(selectedMovableObjects.Count > 0)
{
selectionBoxRotated = false;
startRotation = null;
}
else
CurrentRotatedMoveableObject = null;
}
else if (e.Button == MouseButtons.Middle)
else if (e.Button == MouseButtons.Middle && selectedMovableObjects.Count == 0)
{
if (Math.Abs(middlePressLocation.X - mapHScrollBar.Value) < 10 && Math.Abs(middlePressLocation.Y - mapVScrollBar.Value) < 10)
{