* The mplayer.ini file tweaks are now only applied if RA's Aftermath expansion units are enabled, as it should.
* The editor will now be allowed to load in classic mode without the RA expansion files present. Any missing graphics will be substituted by dummy graphics. * Overhauled the "New Map" dialog using listboxes, to have more consistent tab order control, and to more easily mod in additional games / theaters. * Added "Single-Player Scenario" checkbox on the "New Map" dialog. * Added remap logic to fix Einstein's colors, using the remap system used by the other civilians. * The power evaluation tool now takes buildings' damaged status into account. * Multiple overlapping multiplayer flags will now be drawn as multiple flags on one cell, scaling down later overlapping ones. * Multiple overlapping non-flag waypoints will no longer show up brighter on the map.
This commit is contained in:
parent
14c246cb18
commit
4f06a4a967
16
CHANGELOG.md
16
CHANGELOG.md
@ -314,7 +314,7 @@ Released on 14 Nov 2022 at 22:25 GMT
|
||||
* The damaged state of buildings now works correctly per game; for TD it shows below 50%, for RA it shows at 50%.
|
||||
* Changed waypoints to actual map objects, indicated using the green beacon graphic that was already used as icon for the Waypoints editing mode. They can be disabled in the View menu.
|
||||
* Waypoint labels are now drawn at the bottom of the cell, in the same style as the building rebuild priority labels. They can be disabled in the View menu, but like the building labels, they will not be drawn if Waypoints are not enabled.
|
||||
* Multiplayer starting points are now shown as colored flags. For TD, Nod's metallic blue will be used for the 7th flag (P6). For SS, which has classic colour order configured, metallic gray is the 4th flag (TM3), and the new bright blue is the 7th (TM6). For both TD and SS, the 8th flag has its value hardcoded as the purple from RA.
|
||||
* Multiplayer starting points are now shown as colored flags. For TD, Nod's metallic blue will be used for the 7th flag (P6). For SS, which has classic color order configured, metallic gray is the 4th flag (TM3), and the new bright blue is the 7th (TM6). For both TD and SS, the 8th flag has its value hardcoded as the purple from RA.
|
||||
* Waypoints now show a preview in placement mode.
|
||||
* On Sole Survivor maps, there is a special "Football goal areas" indicator that shows how much area around the flag needs to be left open to be paved with concrete in Football mode. These can be disabled under "View" → "Indicators".
|
||||
* The game name of the opened map type is now shown in the title bar.
|
||||
@ -392,7 +392,7 @@ Released on 03 Apr 2023 at 19:20 GMT
|
||||
* The total map resources value on the resource placement tool will now be calculated correctly (including the game bug that makes the last harvested stage never give any money).
|
||||
* The resource placement tool will now specifically show a value for the total map resources accessible inside the map bounds.
|
||||
* Reinstated the restriction on placing overlay on the first and last row on the map, to correctly emulate the fact the games do not place overlay there.
|
||||
* Added "New map from image" feature, so the rough layout of a map can be designed in an image editor. Each colour in the image can be assigned to a tile.
|
||||
* Added "New map from image" feature, so the rough layout of a map can be designed in an image editor. Each color in the image can be assigned to a tile.
|
||||
* A new "Safe tile dragging" feature ensures that drag-placing a line of tileset pieces will now tile them without overwriting most of the placed content on each new moved cell.
|
||||
* Red Alert Interior Theater no longer allows placing down Smudge types.
|
||||
* Double-clicking on map objects with mouse buttons other than the left one will no longer open the object properties.
|
||||
@ -532,7 +532,7 @@ Released on 12 Jul 2023 at 08:28 GMT
|
||||
* Fixed bugs that crashed the undo/redo function on the waypoints tool.
|
||||
* Fixed tree names not getting initialised.
|
||||
* Fixed Tiberian Dawn's Blossom Trees showing the "barnacled" state at the start of their mutation, rather than their fully mutated state.
|
||||
* Fixed colour corruption that occurred on some systems when showing semitransparent images in Classic mode. All internal image handling now uses 32 bpp images.
|
||||
* Fixed color corruption that occurred on some systems when showing semitransparent images in Classic mode. All internal image handling now uses 32 bpp images.
|
||||
* Fixed a crash in the mod lookup logic on PCs where Steam isn't installed.
|
||||
* Fixed bug where selecting an incorrect C&C Remastered folder would still close the dialog and save the incorrect path after showing the warning.
|
||||
* Groups of trees are now indicated as "Trees" instead of "Tree".
|
||||
@ -570,6 +570,14 @@ Unreleased
|
||||
* Fixed bug where two buildings of different types placed on the same cell (e.g. a guard tower on the top-left corner of a repair bay) would not correctly be distinguished as different entries by the rebuild priority system, causing one of them to lose its rebuild status.
|
||||
* The "Learning" and "Mercenary" options in the TD Teamtypes editor are now crossed out in the UI, and indicated on the tooltip as having no effect.
|
||||
* Megamaps for TD can now be published on the Steam workshop, provided they are singleplayer scenarios. They will give a warning about the nonstandard format, though this is not re-shown for the same map on subsequent uploads.
|
||||
* Added forgotten PageUp/PageDown/Home/End support to Walls tool.
|
||||
* Added forgotten PageUp/PageDown/Home/End shortcuts support to Walls tool.
|
||||
* V37 is now seen as a "flat" building, so its top left corner can't overlap other objects.
|
||||
* Fixed column resizing in the triggers list so it always maximizes the clickable area to select a trigger, and never gives scrollbars unless needed.
|
||||
* The mplayer.ini file tweaks are now only applied if RA's Aftermath expansion units are enabled, as it should.
|
||||
* The editor will now be allowed to load in classic mode without the RA expansion files present. Any missing graphics will be substituted by dummy graphics.
|
||||
* Overhauled the "New Map" dialog using listboxes, to have more consistent tab order control, and to more easily mod in additional games / theaters.
|
||||
* Added "Single-Player Scenario" checkbox on the "New Map" dialog.
|
||||
* Added remap logic to fix Einstein's colors, using the remap system used by the other civilians.
|
||||
* The power evaluation tool now takes buildings' damaged status into account.
|
||||
* Multiple overlapping multiplayer flags will now be drawn as multiple flags on one cell, scaling down later overlapping ones.
|
||||
* Multiple overlapping non-flag waypoints will no longer show up brighter on the map.
|
||||
|
@ -91,7 +91,7 @@ namespace MobiusEditor.Controls
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.Info.Type = ListItem.GetValueFromDropdown(this.cmbTechno, defaultType);
|
||||
this.Info.Type = ListItem.GetValueFromComboBox(this.cmbTechno, defaultType);
|
||||
}
|
||||
|
||||
private void numAmount_ValueChanged(Object sender, EventArgs e)
|
||||
|
183
CnCTDRAMapEditor/Dialogs/NewMapDialog.Designer.cs
generated
183
CnCTDRAMapEditor/Dialogs/NewMapDialog.Designer.cs
generated
@ -48,24 +48,17 @@ namespace MobiusEditor.Dialogs
|
||||
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.radioSS = 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.chkMegamap = new System.Windows.Forms.CheckBox();
|
||||
this.lblWarning = new System.Windows.Forms.Label();
|
||||
this.lbGames = new System.Windows.Forms.ListBox();
|
||||
this.lbTheaters = new System.Windows.Forms.ListBox();
|
||||
this.chkSingleplayer = new System.Windows.Forms.CheckBox();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.flowLayoutPanel2.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.flowLayoutPanel3.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.flowLayoutPanel4.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
@ -97,7 +90,7 @@ namespace MobiusEditor.Dialogs
|
||||
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(352, 27);
|
||||
this.flowLayoutPanel1.TabIndex = 2;
|
||||
this.flowLayoutPanel1.TabIndex = 4;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
@ -127,6 +120,7 @@ namespace MobiusEditor.Dialogs
|
||||
//
|
||||
this.flowLayoutPanel2.Controls.Add(this.groupBox1);
|
||||
this.flowLayoutPanel2.Controls.Add(this.groupBox2);
|
||||
this.flowLayoutPanel2.Controls.Add(this.chkSingleplayer);
|
||||
this.flowLayoutPanel2.Controls.Add(this.chkMegamap);
|
||||
this.flowLayoutPanel2.Controls.Add(this.lblWarning);
|
||||
this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
@ -139,142 +133,37 @@ namespace MobiusEditor.Dialogs
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.flowLayoutPanel3);
|
||||
this.groupBox1.Controls.Add(this.lbGames);
|
||||
this.groupBox1.Location = new System.Drawing.Point(2, 2);
|
||||
this.groupBox1.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Padding = new System.Windows.Forms.Padding(2);
|
||||
this.groupBox1.Size = new System.Drawing.Size(339, 89);
|
||||
this.groupBox1.Size = new System.Drawing.Size(339, 95);
|
||||
this.groupBox1.TabIndex = 0;
|
||||
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.Controls.Add(this.radioSS);
|
||||
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);
|
||||
this.flowLayoutPanel3.Name = "flowLayoutPanel3";
|
||||
this.flowLayoutPanel3.Size = new System.Drawing.Size(335, 72);
|
||||
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);
|
||||
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);
|
||||
this.radioRA.Name = "radioRA";
|
||||
this.radioRA.Size = new System.Drawing.Size(69, 17);
|
||||
this.radioRA.TabIndex = 1;
|
||||
this.radioRA.TabStop = true;
|
||||
this.radioRA.Text = "Red Alert";
|
||||
this.radioRA.UseVisualStyleBackColor = true;
|
||||
this.radioRA.CheckedChanged += new System.EventHandler(this.radioGameType_CheckedChanged);
|
||||
//
|
||||
// radioSS
|
||||
//
|
||||
this.radioSS.AutoSize = true;
|
||||
this.radioSS.Location = new System.Drawing.Point(2, 44);
|
||||
this.radioSS.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.radioSS.Name = "radioSS";
|
||||
this.radioSS.Size = new System.Drawing.Size(88, 17);
|
||||
this.radioSS.TabIndex = 2;
|
||||
this.radioSS.TabStop = true;
|
||||
this.radioSS.Text = "Sole Survivor";
|
||||
this.radioSS.UseVisualStyleBackColor = true;
|
||||
this.radioSS.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, 95);
|
||||
this.groupBox2.Controls.Add(this.lbTheaters);
|
||||
this.groupBox2.Location = new System.Drawing.Point(2, 101);
|
||||
this.groupBox2.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Padding = new System.Windows.Forms.Padding(2);
|
||||
this.groupBox2.Size = new System.Drawing.Size(339, 89);
|
||||
this.groupBox2.Size = new System.Drawing.Size(339, 95);
|
||||
this.groupBox2.TabIndex = 1;
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
this.radioTheater2.Name = "radioTheater2";
|
||||
this.radioTheater2.Size = new System.Drawing.Size(76, 17);
|
||||
this.radioTheater2.TabIndex = 1;
|
||||
this.radioTheater2.TabStop = true;
|
||||
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);
|
||||
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;
|
||||
//
|
||||
// chkMegamap
|
||||
//
|
||||
this.chkMegamap.AutoSize = true;
|
||||
this.chkMegamap.Location = new System.Drawing.Point(7, 189);
|
||||
this.chkMegamap.Location = new System.Drawing.Point(7, 224);
|
||||
this.chkMegamap.Margin = new System.Windows.Forms.Padding(7, 3, 3, 3);
|
||||
this.chkMegamap.Name = "chkMegamap";
|
||||
this.chkMegamap.Size = new System.Drawing.Size(177, 17);
|
||||
this.chkMegamap.TabIndex = 2;
|
||||
this.chkMegamap.TabIndex = 3;
|
||||
this.chkMegamap.Text = "Megamap (Sole Survivor format)";
|
||||
this.chkMegamap.UseVisualStyleBackColor = true;
|
||||
this.chkMegamap.CheckedChanged += new System.EventHandler(this.chkMegamap_CheckedChanged);
|
||||
@ -283,7 +172,7 @@ namespace MobiusEditor.Dialogs
|
||||
//
|
||||
this.lblWarning.AutoSize = true;
|
||||
this.lblWarning.ForeColor = System.Drawing.Color.Red;
|
||||
this.lblWarning.Location = new System.Drawing.Point(7, 212);
|
||||
this.lblWarning.Location = new System.Drawing.Point(7, 247);
|
||||
this.lblWarning.Margin = new System.Windows.Forms.Padding(7, 3, 3, 3);
|
||||
this.lblWarning.Name = "lblWarning";
|
||||
this.lblWarning.Size = new System.Drawing.Size(331, 26);
|
||||
@ -292,6 +181,35 @@ namespace MobiusEditor.Dialogs
|
||||
"lection without modding.";
|
||||
this.lblWarning.Visible = false;
|
||||
//
|
||||
// lbGames
|
||||
//
|
||||
this.lbGames.FormattingEnabled = true;
|
||||
this.lbGames.Location = new System.Drawing.Point(5, 18);
|
||||
this.lbGames.Name = "lbGames";
|
||||
this.lbGames.Size = new System.Drawing.Size(326, 69);
|
||||
this.lbGames.TabIndex = 0;
|
||||
this.lbGames.SelectedIndexChanged += new System.EventHandler(this.lbGames_SelectedIndexChanged);
|
||||
//
|
||||
// lbTheaters
|
||||
//
|
||||
this.lbTheaters.FormattingEnabled = true;
|
||||
this.lbTheaters.Location = new System.Drawing.Point(5, 18);
|
||||
this.lbTheaters.Name = "lbTheaters";
|
||||
this.lbTheaters.Size = new System.Drawing.Size(326, 69);
|
||||
this.lbTheaters.TabIndex = 0;
|
||||
//
|
||||
// chkSingleplayer
|
||||
//
|
||||
this.chkSingleplayer.AutoSize = true;
|
||||
this.chkSingleplayer.Location = new System.Drawing.Point(7, 201);
|
||||
this.chkSingleplayer.Margin = new System.Windows.Forms.Padding(7, 3, 3, 3);
|
||||
this.chkSingleplayer.Name = "chkSingleplayer";
|
||||
this.chkSingleplayer.Size = new System.Drawing.Size(132, 17);
|
||||
this.chkSingleplayer.TabIndex = 2;
|
||||
this.chkSingleplayer.Text = "Single-Player Scenario";
|
||||
this.chkSingleplayer.UseVisualStyleBackColor = true;
|
||||
this.chkSingleplayer.CheckedChanged += new System.EventHandler(this.chkMegamap_CheckedChanged);
|
||||
//
|
||||
// NewMapDialog
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
@ -318,13 +236,7 @@ namespace MobiusEditor.Dialogs
|
||||
this.flowLayoutPanel2.ResumeLayout(false);
|
||||
this.flowLayoutPanel2.PerformLayout();
|
||||
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);
|
||||
|
||||
}
|
||||
@ -338,15 +250,10 @@ namespace MobiusEditor.Dialogs
|
||||
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;
|
||||
private System.Windows.Forms.CheckBox chkMegamap;
|
||||
private System.Windows.Forms.RadioButton radioSS;
|
||||
private System.Windows.Forms.Label lblWarning;
|
||||
private System.Windows.Forms.ListBox lbGames;
|
||||
private System.Windows.Forms.ListBox lbTheaters;
|
||||
private System.Windows.Forms.CheckBox chkSingleplayer;
|
||||
}
|
||||
}
|
@ -13,38 +13,58 @@
|
||||
// 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.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
public partial class NewMapDialog : Form
|
||||
{
|
||||
private GameType[] gameTypes = new[]
|
||||
{
|
||||
GameType.TiberianDawn,
|
||||
GameType.RedAlert,
|
||||
GameType.SoleSurvivor
|
||||
};
|
||||
|
||||
private Dictionary<GameType, String> gameTypeNames = new Dictionary<GameType, string>
|
||||
{
|
||||
{ GameType.TiberianDawn, "Tiberian Dawn" },
|
||||
{ GameType.RedAlert, "Red Alert" },
|
||||
{ GameType.SoleSurvivor, "Sole Survivor" }
|
||||
};
|
||||
|
||||
private Dictionary<GameType, TheaterType[]> theaters = new Dictionary<GameType, TheaterType[]>()
|
||||
{
|
||||
{ GameType.TiberianDawn, TiberianDawn.TheaterTypes.GetTypes().ToArray() },
|
||||
{ GameType.RedAlert, RedAlert.TheaterTypes.GetTypes().ToArray() },
|
||||
{ GameType.SoleSurvivor, TiberianDawn.TheaterTypes.GetTypes().ToArray() }
|
||||
};
|
||||
|
||||
private bool tdMegaMapChecked = false;
|
||||
|
||||
private GameType gameType = GameType.TiberianDawn;
|
||||
public GameType GameType
|
||||
{
|
||||
get => gameType;
|
||||
get
|
||||
{
|
||||
return ListItem.GetValueFromListBox<GameType>(lbGames);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (gameType != value)
|
||||
{
|
||||
gameType = value;
|
||||
switch (value)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
radioTD.Checked = true;
|
||||
chkMegamap.Checked = false;
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
radioRA.Checked = true;
|
||||
break;
|
||||
case GameType.SoleSurvivor:
|
||||
radioSS.Checked = true;
|
||||
chkMegamap.Checked = true;
|
||||
break;
|
||||
}
|
||||
UpdateGameType();
|
||||
}
|
||||
lbGames.SelectedIndex = Array.IndexOf(gameTypes, value);
|
||||
}
|
||||
}
|
||||
|
||||
public String Theater
|
||||
{
|
||||
get
|
||||
{
|
||||
return ListItem.GetValueFromListBox<TheaterType>(lbTheaters)?.Name;
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,14 +76,11 @@ namespace MobiusEditor.Dialogs
|
||||
}
|
||||
}
|
||||
|
||||
public string TheaterName
|
||||
public bool SinglePlayer
|
||||
{
|
||||
get
|
||||
{
|
||||
if (radioTheater1.Checked) return radioTheater1.Text;
|
||||
if (radioTheater2.Checked) return radioTheater2.Text;
|
||||
if (radioTheater3.Checked) return radioTheater3.Text;
|
||||
return null;
|
||||
return chkSingleplayer.Checked && gameType != GameType.SoleSurvivor;
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,50 +91,66 @@ namespace MobiusEditor.Dialogs
|
||||
{
|
||||
this.Text = "New Map From Image";
|
||||
}
|
||||
foreach (GameType gt in this.gameTypes)
|
||||
{
|
||||
lbGames.Items.Add(new ListItem<GameType>(gt, this.gameTypeNames[gt]));
|
||||
}
|
||||
lbGames.SelectedIndex = 0;
|
||||
lbGames_SelectedIndexChanged(null, null);
|
||||
}
|
||||
|
||||
private void UpdateGameType()
|
||||
private void lbGames_SelectedIndexChanged(Object sender, EventArgs e)
|
||||
{
|
||||
switch(GameType)
|
||||
if (lbGames.SelectedIndex >= gameTypes.Length)
|
||||
{
|
||||
lbGames.SelectedIndex = 0;
|
||||
return;
|
||||
}
|
||||
String selectedTheater = lbTheaters.Text;
|
||||
gameType = gameTypes[lbGames.SelectedIndex];
|
||||
lbTheaters.Items.Clear();
|
||||
int selectIndex = -1;
|
||||
if (theaters.TryGetValue(gameType, out TheaterType[] ttypes))
|
||||
{
|
||||
for (Int32 i = 0; i < ttypes.Length; ++i)
|
||||
{
|
||||
TheaterType tt = ttypes[i];
|
||||
lbTheaters.Items.Add(new ListItem<TheaterType>(tt, tt.Name));
|
||||
if (String.Equals(selectedTheater, tt.Name, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
selectIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
lbTheaters.SelectedIndex = selectIndex != -1 ? selectIndex : 0;
|
||||
switch (gameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
case GameType.SoleSurvivor:
|
||||
{
|
||||
radioTheater1.Text = "Desert";
|
||||
radioTheater2.Text = "Temperate";
|
||||
radioTheater3.Text = "Winter";
|
||||
} break;
|
||||
chkMegamap.Checked = tdMegaMapChecked;
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
{
|
||||
radioTheater1.Text = "Temperate";
|
||||
radioTheater2.Text = "Snow";
|
||||
radioTheater3.Text = "Interior";
|
||||
}
|
||||
break;
|
||||
case GameType.SoleSurvivor:
|
||||
chkMegamap.Checked = true;
|
||||
break;
|
||||
}
|
||||
chkMegamap.Visible = GameType == GameType.TiberianDawn || GameType == GameType.SoleSurvivor;
|
||||
lblWarning.Visible = (chkMegamap.Visible && chkMegamap.Checked) || GameType == GameType.SoleSurvivor;
|
||||
}
|
||||
|
||||
private void radioGameType_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (radioTD.Checked)
|
||||
{
|
||||
GameType = GameType.TiberianDawn;
|
||||
}
|
||||
else if (radioRA.Checked)
|
||||
{
|
||||
GameType = GameType.RedAlert;
|
||||
}
|
||||
else if (radioSS.Checked)
|
||||
{
|
||||
GameType = GameType.SoleSurvivor;
|
||||
}
|
||||
AdjustBottomInfo();
|
||||
}
|
||||
|
||||
private void chkMegamap_CheckedChanged(Object sender, EventArgs e)
|
||||
{
|
||||
UpdateGameType();
|
||||
if (gameType == GameType.TiberianDawn)
|
||||
{
|
||||
tdMegaMapChecked = chkMegamap.Checked;
|
||||
}
|
||||
AdjustBottomInfo();
|
||||
}
|
||||
|
||||
private void AdjustBottomInfo()
|
||||
{
|
||||
chkSingleplayer.Visible = gameType != GameType.SoleSurvivor;
|
||||
chkMegamap.Visible = gameType == GameType.TiberianDawn || gameType == GameType.SoleSurvivor;
|
||||
lblWarning.Visible = !Globals.UseClassicFiles && (chkMegamap.Visible && chkMegamap.Checked) && gameType != GameType.SoleSurvivor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ namespace MobiusEditor.Dialogs
|
||||
plugin.Map.SteamSection.PreviewFile = txtPreview.Text;
|
||||
plugin.Map.SteamSection.Title = txtTitle.Text;
|
||||
plugin.Map.SteamSection.Description = GeneralUtils.ReplaceLinebreaks(txtDescription.Text, '@');
|
||||
plugin.Map.SteamSection.VisibilityAsEnum = ListItem.GetValueFromDropdown<ERemoteStoragePublishedFileVisibility>(cmbVisibility);
|
||||
plugin.Map.SteamSection.VisibilityAsEnum = ListItem.GetValueFromComboBox<ERemoteStoragePublishedFileVisibility>(cmbVisibility);
|
||||
Directory.CreateDirectory(PublishTempDirectory);
|
||||
foreach (var file in new DirectoryInfo(PublishTempDirectory).EnumerateFiles())
|
||||
{
|
||||
|
@ -1108,6 +1108,7 @@ namespace MobiusEditor
|
||||
GameType gameType = GameType.None;
|
||||
string theater = null;
|
||||
bool isTdMegaMap = false;
|
||||
bool isSinglePlay = false;
|
||||
using (NewMapDialog nmd = new NewMapDialog(withImage))
|
||||
{
|
||||
nmd.StartPosition = FormStartPosition.CenterParent;
|
||||
@ -1117,7 +1118,8 @@ namespace MobiusEditor
|
||||
}
|
||||
gameType = nmd.GameType;
|
||||
isTdMegaMap = nmd.MegaMap;
|
||||
theater = nmd.TheaterName;
|
||||
isSinglePlay = nmd.SinglePlayer;
|
||||
theater = nmd.Theater;
|
||||
}
|
||||
if (withImage && imagePath == null)
|
||||
{
|
||||
@ -1138,7 +1140,7 @@ namespace MobiusEditor
|
||||
if (withImage)
|
||||
loading += " from image";
|
||||
loadMultiThreader.ExecuteThreaded(
|
||||
() => NewFile(gameType, imagePath, theater, isTdMegaMap, this),
|
||||
() => NewFile(gameType, imagePath, theater, isTdMegaMap, isSinglePlay, this),
|
||||
PostLoad, true,
|
||||
(e, l) => LoadUnloadUi(e, l, loadMultiThreader),
|
||||
loading);
|
||||
@ -1521,11 +1523,14 @@ namespace MobiusEditor
|
||||
/// <summary>
|
||||
/// The separate-threaded part for making a new map.
|
||||
/// </summary>
|
||||
/// <param name="gameType"></param>
|
||||
/// <param name="theater"></param>
|
||||
/// <param name="isTdMegaMap"></param>
|
||||
/// <param name="gameType">Game type</param>
|
||||
/// <param name="imagePath">Image path, indicating the map is being created from image</param>
|
||||
/// <param name="theater">Theater of the new map</param>
|
||||
/// <param name="isTdMegaMap">Is megamap</param>
|
||||
/// <param name="isSinglePlay">Is singleplayer scenario</param>
|
||||
/// <param name="showTarget">The form to use as target for showing messages / dialogs on.</param>
|
||||
/// <returns></returns>
|
||||
private static MapLoadInfo NewFile(GameType gameType, String imagePath, string theater, bool isTdMegaMap, MainForm showTarget)
|
||||
private static MapLoadInfo NewFile(GameType gameType, String imagePath, string theater, bool isTdMegaMap, bool isSinglePlay, MainForm showTarget)
|
||||
{
|
||||
int imageWidth = 0;
|
||||
int imageHeight = 0;
|
||||
@ -1560,6 +1565,7 @@ namespace MobiusEditor
|
||||
// This initialises the theater
|
||||
plugin.New(theater);
|
||||
mapLoaded = true;
|
||||
plugin.Map.BasicSection.SoloMission = isSinglePlay;
|
||||
if (SteamworksUGC.IsInit)
|
||||
{
|
||||
try
|
||||
|
@ -2087,14 +2087,24 @@ namespace MobiusEditor.Model
|
||||
{
|
||||
if (housesWithProd.Contains(house.Name))
|
||||
{
|
||||
powerWithUnbuilt[house.Name] = new int[2];
|
||||
powerWithUnbuilt[house.Name] = new int[3];
|
||||
}
|
||||
powerWithoutUnbuilt[house.Name] = new int[2];
|
||||
powerWithoutUnbuilt[house.Name] = new int[3];
|
||||
}
|
||||
HashSet<String> hasDamagedPowerPlants = new HashSet<string>(StringComparer.CurrentCultureIgnoreCase);
|
||||
foreach ((_, Building bld) in this.Buildings.OfType<Building>())
|
||||
{
|
||||
int bldUsage = bld.Type.PowerUsage;
|
||||
int bldProd = bld.Type.PowerProduction;
|
||||
int bldProdHealthy = bld.Type.PowerProduction;
|
||||
int bldProdCur = bld.Type.PowerProduction;
|
||||
if (bld.IsPrebuilt)
|
||||
{
|
||||
if (bld.Strength < 256 && bldProdCur > 0)
|
||||
{
|
||||
hasDamagedPowerPlants.Add(bld.House.Name);
|
||||
}
|
||||
bldProdCur = bldProdCur * bld.Strength / 256;
|
||||
}
|
||||
int[] housePwr;
|
||||
// These should all belong to the "rebuild house" due to internal property change listeners; no need to explicitly check.
|
||||
if (!bld.IsPrebuilt)
|
||||
@ -2104,19 +2114,22 @@ namespace MobiusEditor.Model
|
||||
if (powerWithUnbuilt.TryGetValue(house, out housePwr))
|
||||
{
|
||||
housePwr[0] += bldUsage;
|
||||
housePwr[1] += bldProd;
|
||||
housePwr[1] += bldProdHealthy;
|
||||
housePwr[2] += bldProdHealthy;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (powerWithUnbuilt.TryGetValue(bld.House.Name, out housePwr))
|
||||
{
|
||||
housePwr[0] += bldUsage;
|
||||
housePwr[1] += bldProd;
|
||||
housePwr[1] += bldProdCur;
|
||||
housePwr[2] += bldProdHealthy;
|
||||
}
|
||||
if (bld.IsPrebuilt && powerWithoutUnbuilt.TryGetValue(bld.House.Name, out housePwr))
|
||||
{
|
||||
housePwr[0] += bldUsage;
|
||||
housePwr[1] += bldProd;
|
||||
housePwr[1] += bldProdCur;
|
||||
housePwr[2] += bldProdHealthy;
|
||||
}
|
||||
}
|
||||
List<string> info = new List<string>();
|
||||
@ -2133,26 +2146,36 @@ namespace MobiusEditor.Model
|
||||
{
|
||||
int[] housePwrAll;
|
||||
int[] housePwrBuilt;
|
||||
if (powerWithUnbuilt.TryGetValue(house.Name, out housePwrAll))
|
||||
bool hasDamaged = hasDamagedPowerPlants.Contains(house.Name);
|
||||
if (powerWithoutUnbuilt.TryGetValue(house.Name, out housePwrBuilt))
|
||||
{
|
||||
powerWithoutUnbuilt.TryGetValue(house.Name, out housePwrBuilt);
|
||||
int houseUsage = housePwrAll[0]; // PowerUsage;
|
||||
int houseProd = housePwrAll[1]; // PowerProduction;
|
||||
StringBuilder houseInfo = new StringBuilder();
|
||||
int houseUsageBuilt = housePwrBuilt[0]; // PowerUsage;
|
||||
int houseProdBuilt = housePwrBuilt[1]; // PowerProduction;
|
||||
|
||||
String houseInfo = String.Format("{0}: {1} - Produces {2}, uses {3}. (Without unbuilt: {4} - Produces {5}, uses {6}.)",
|
||||
house.Name, houseProd < houseUsage ? "!!" : "OK", houseProd, houseUsage,
|
||||
houseProdBuilt < houseUsageBuilt ? "!!" : "OK", houseProdBuilt, houseUsageBuilt);
|
||||
info.Add(houseInfo);
|
||||
}
|
||||
else if (powerWithoutUnbuilt.TryGetValue(house.Name, out housePwrBuilt))
|
||||
{
|
||||
int houseUsageBuilt = housePwrBuilt[0]; // PowerUsage;
|
||||
int houseProdBuilt = housePwrBuilt[1]; // PowerProduction;
|
||||
String houseInfo = String.Format("{0}: {1} - Produces {2}, uses {3}.",
|
||||
house.Name, houseProdBuilt < houseUsageBuilt ? "!!" : "OK", houseProdBuilt, houseUsageBuilt);
|
||||
info.Add(houseInfo);
|
||||
int houseProdBuilt = housePwrBuilt[1]; // PowerProduction at actual strength;
|
||||
int houseProdBuiltHealthy = housePwrBuilt[2]; // PowerProduction when healthy;
|
||||
houseInfo.Append(house.Name).Append(": ");
|
||||
bool hasUnbuilt = powerWithUnbuilt.TryGetValue(house.Name, out housePwrAll);
|
||||
if (hasUnbuilt)
|
||||
{
|
||||
int houseUsage = housePwrAll[0]; // PowerUsage;
|
||||
int houseProd = housePwrAll[1]; // PowerProduction;
|
||||
int houseProdHealthy = housePwrAll[2]; // PowerProduction when healthy;
|
||||
houseInfo.Append(houseProd < houseUsage ? "!!" : "OK").Append(" - ");
|
||||
if (hasDamaged) houseInfo.Append("Has damaged power plants. ");
|
||||
houseInfo.Append("Produces ").Append(houseProd);
|
||||
if (hasDamaged)
|
||||
houseInfo.Append(" currently; ").Append(houseProdHealthy).Append(" at full strength");
|
||||
houseInfo.Append(", uses ").Append(houseUsage).Append(".");
|
||||
houseInfo.Append(" Without unbuilt: ");
|
||||
}
|
||||
houseInfo.Append(houseProdBuilt < houseUsageBuilt ? "!!" : "OK").Append(" - ");
|
||||
if (hasDamaged && !hasUnbuilt) houseInfo.Append("Has damaged power plants. ");
|
||||
houseInfo.Append("Produces ").Append(houseProdBuilt);
|
||||
if (hasDamaged)
|
||||
houseInfo.Append(" currently; ").Append(houseProdBuiltHealthy).Append(" at full strength");
|
||||
houseInfo.Append(", uses ").Append(houseUsageBuilt).Append(".");
|
||||
|
||||
info.Add(houseInfo.ToString());
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
@ -417,13 +417,16 @@ namespace MobiusEditor.RedAlert
|
||||
{
|
||||
UpdateRules(rulesIni, this.Map, forFootprintTest);
|
||||
}
|
||||
if (this.aftermathRulesIni != null && expansionEnabled)
|
||||
if (expansionEnabled)
|
||||
{
|
||||
UpdateRules(aftermathRulesIni, this.Map, forFootprintTest);
|
||||
}
|
||||
if (this.multiplayRulesIni != null && !isSolo)
|
||||
{
|
||||
UpdateRules(multiplayRulesIni, this.Map, forFootprintTest);
|
||||
if (this.aftermathRulesIni != null)
|
||||
{
|
||||
UpdateRules(aftermathRulesIni, this.Map, forFootprintTest);
|
||||
}
|
||||
if (this.multiplayRulesIni != null && !isSolo)
|
||||
{
|
||||
UpdateRules(multiplayRulesIni, this.Map, forFootprintTest);
|
||||
}
|
||||
}
|
||||
IEnumerable<string> errors = null;
|
||||
if (extraTextIni != null)
|
||||
|
@ -23,31 +23,31 @@ namespace MobiusEditor.RedAlert
|
||||
{
|
||||
public static byte[] RemapCiv2 =
|
||||
{
|
||||
0,1,2,3,4,5,6,209,8,9,10,11,12,13,12,15, // 0..15
|
||||
16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, // 16..31
|
||||
32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, // 32..47
|
||||
48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, // 48..63
|
||||
64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, // 64..79
|
||||
80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, // 80..95
|
||||
96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111, // 96..111
|
||||
000,001,002,003,004,005,006,209,008,009,010,011,012,013,012,015, // 000..015
|
||||
016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031, // 016..031
|
||||
032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047, // 032..047
|
||||
048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063, // 048..063
|
||||
064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079, // 064..079
|
||||
080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095, // 080..095
|
||||
096,097,098,099,100,101,102,103,104,105,106,107,108,109,110,111, // 096..111
|
||||
112,113,114,115,116,117,187,188,120,121,122,123,124,125,126,127, // 112..127
|
||||
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 128..143
|
||||
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,209, // 144..159
|
||||
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // 160..175
|
||||
176,177,178,179,180,181,182,183,184,185,186,167, 13,189,190,191, // 176..191
|
||||
176,177,178,179,180,181,182,183,184,185,186,167,013,189,190,191, // 176..191
|
||||
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // 192..207
|
||||
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // 208..223
|
||||
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // 224..239
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
};
|
||||
public static byte[] RemapCiv4 = {
|
||||
0,1,2,3,4,5,6,187,8,9,10,11,12,13,14,15, // 0..15
|
||||
16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, // 16..31
|
||||
32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, // 32..47
|
||||
48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, // 48..63
|
||||
64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, // 64..79
|
||||
80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, // 80..95
|
||||
96,97,98,99,100,101,102,103,104,105,106,107,108,118,110,119, // 96..111
|
||||
000,001,002,003,004,005,006,187,008,009,010,011,012,013,014,015, // 000..015
|
||||
016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031, // 016..031
|
||||
032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047, // 032..047
|
||||
048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063, // 048..063
|
||||
064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079, // 064..079
|
||||
080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095, // 080..095
|
||||
096,097,098,099,100,101,102,103,104,105,106,107,108,118,110,119, // 096..111
|
||||
112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, // 112..127
|
||||
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 128..143
|
||||
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 144..159
|
||||
@ -56,16 +56,16 @@ namespace MobiusEditor.RedAlert
|
||||
192,193,194,195,196,197,198,199,200,201,202,203,204,205,188,207, // 192..207
|
||||
208,209,182,211,212,213,214,215,216,217,218,219,220,221,222,223, // 208..223
|
||||
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // 224..239
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
};
|
||||
public static byte[] RemapCiv5 = {
|
||||
0,1,2,3,4,5,6,109,8,9,10,11,131,13,14,15, // 0..15
|
||||
16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, // 16..31
|
||||
32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, // 32..47
|
||||
48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, // 48..63
|
||||
64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, // 64..79
|
||||
80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, // 80..95
|
||||
96,97,98,99,100,101,102,103,104,105,106,107,108,177,110,178, // 96..111
|
||||
000,001,002,003,004,005,006,109,008,009,010,011,131,013,014,015, // 000..015
|
||||
016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031, // 016..031
|
||||
032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047, // 032..047
|
||||
048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063, // 048..063
|
||||
064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079, // 064..079
|
||||
080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095, // 080..095
|
||||
096,097,098,099,100,101,102,103,104,105,106,107,108,177,110,178, // 096..111
|
||||
112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, // 112..127
|
||||
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 128..143
|
||||
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 144..159
|
||||
@ -74,16 +74,16 @@ namespace MobiusEditor.RedAlert
|
||||
192,193,194,195,196,197,198,199,111,201,202,203,204,205,111,207, // 192..207
|
||||
208,209,182,211,212,213,214,215,216,217,218,219,220,221,222,223, // 208..223
|
||||
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // 224..239
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
};
|
||||
public static byte[] RemapCiv6 = {
|
||||
0,1,2,3,4,5,6,120,8,9,10,11,12,13,238,15, // 0..15
|
||||
16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, // 16..31
|
||||
32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, // 32..47
|
||||
48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, // 48..63
|
||||
64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, // 64..79
|
||||
80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, // 80..95
|
||||
96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111, // 96..111
|
||||
000,001,002,003,004,005,006,120,008,009,010,011,012,013,238,015, // 000..015
|
||||
016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031, // 016..031
|
||||
032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047, // 032..047
|
||||
048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063, // 048..063
|
||||
064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079, // 064..079
|
||||
080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095, // 080..095
|
||||
096,097,098,099,100,101,102,103,104,105,106,107,108,109,110,111, // 096..111
|
||||
112,113,114,115,116,117,236,206,120,121,122,123,124,125,126,127, // 112..127
|
||||
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 128..143
|
||||
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,111, // 144..159
|
||||
@ -92,35 +92,35 @@ namespace MobiusEditor.RedAlert
|
||||
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // 192..207
|
||||
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // 208..223
|
||||
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // 224..239
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
};
|
||||
public static byte[] RemapCiv7 = {
|
||||
0,1,2,3,4,5,6,7,8,9,10,11,12,13,131,15, // 0..15
|
||||
16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, // 16..31
|
||||
32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, // 32..47
|
||||
48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, // 48..63
|
||||
64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, // 64..79
|
||||
80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, // 80..95
|
||||
96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111, // 96..111
|
||||
000,001,002,003,004,005,006,007,008,009,010,011,012,013,131,015, // 000..015
|
||||
016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031, // 016..031
|
||||
032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047, // 032..047
|
||||
048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063, // 048..063
|
||||
064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079, // 064..079
|
||||
080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095, // 080..095
|
||||
096,097,098,099,100,101,102,103,104,105,106,107,108,109,110,111, // 096..111
|
||||
112,113,114,115,116,117,157,212,120,121,122,123,124,125,126,127, // 112..127
|
||||
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 128..143
|
||||
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,7, // 144..159
|
||||
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,007, // 144..159
|
||||
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // 160..175
|
||||
176,177,178,179,180,181,182,183,184,185,186,118,119,189,190,191, // 176..191
|
||||
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // 192..207
|
||||
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // 208..223
|
||||
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // 224..239
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
};
|
||||
public static byte[] RemapCiv8 = {
|
||||
0,1,2,3,4,5,6,182,8,9,10,11,12,13,131,15, // 0..15
|
||||
16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, // 16..31
|
||||
32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, // 32..47
|
||||
48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, // 48..63
|
||||
64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, // 64..79
|
||||
80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, // 80..95
|
||||
96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111, // 96..111
|
||||
112,113,114,115,116,117,215,7,120,121,122,123,124,125,126,127, // 112..127
|
||||
000,001,002,003,004,005,006,182,008,009,010,011,012,013,131,015, // 000..015
|
||||
016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031, // 016..031
|
||||
032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047, // 032..047
|
||||
048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063, // 048..063
|
||||
064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079, // 064..079
|
||||
080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095, // 080..095
|
||||
096,097,098,099,100,101,102,103,104,105,106,107,108,109,110,111, // 096..111
|
||||
112,113,114,115,116,117,215,007,120,121,122,123,124,125,126,127, // 112..127
|
||||
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 128..143
|
||||
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,182, // 144..159
|
||||
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // 160..175
|
||||
@ -128,34 +128,51 @@ namespace MobiusEditor.RedAlert
|
||||
192,193,194,195,196,197,198,199,111,201,202,203,204,205,206,207, // 192..207
|
||||
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // 208..223
|
||||
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // 224..239
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 014 => 007,
|
||||
/// 118 => 163,
|
||||
/// 119 => 165
|
||||
/// 159 => 200,
|
||||
/// 187 => 111,
|
||||
/// 188 => 013
|
||||
/// </summary>
|
||||
public static byte[] RemapCiv9 = {
|
||||
0,1,2,3,4,5,6,7,8,9,10,11,12,13,7,15, // 0..15
|
||||
16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, // 16..31
|
||||
32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, // 32..47
|
||||
48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, // 48..63
|
||||
64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, // 64..79
|
||||
80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, // 80..95
|
||||
96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111, // 96..111
|
||||
000,001,002,003,004,005,006,007,008,009,010,011,012,013,007,015, // 000..015
|
||||
016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031, // 016..031
|
||||
032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047, // 032..047
|
||||
048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063, // 048..063
|
||||
064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079, // 064..079
|
||||
080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095, // 080..095
|
||||
096,097,098,099,100,101,102,103,104,105,106,107,108,109,110,111, // 096..111
|
||||
112,113,114,115,116,117,163,165,120,121,122,123,124,125,126,127, // 112..127
|
||||
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 128..143
|
||||
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,200, // 144..159
|
||||
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // 160..175
|
||||
176,177,178,179,180,181,182,183,184,185,186,111,13,189,190,191, // 176..191
|
||||
176,177,178,179,180,181,182,183,184,185,186,111,013,189,190,191, // 176..191
|
||||
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // 192..207
|
||||
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // 208..223
|
||||
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // 224..239
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 007 => 137,
|
||||
/// 014 => 015,
|
||||
/// 118 => 129,
|
||||
/// 159 => 137,
|
||||
/// 187 => 163
|
||||
/// </summary>
|
||||
public static byte[] RemapCiv10 = {
|
||||
0,1,2,3,4,5,6,137,8,9,10,11,12,13,15,15, // 0..15
|
||||
16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, // 16..31
|
||||
32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, // 32..47
|
||||
48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, // 48..63
|
||||
64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, // 64..79
|
||||
80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, // 80..95
|
||||
96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111, // 96..111
|
||||
000,001,002,003,004,005,006,137,008,009,010,011,012,013,015,015, // 000..015
|
||||
016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031, // 016..031
|
||||
032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047, // 032..047
|
||||
048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063, // 048..063
|
||||
064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079, // 064..079
|
||||
080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095, // 080..095
|
||||
096,097,098,099,100,101,102,103,104,105,106,107,108,109,110,111, // 096..111
|
||||
112,113,114,115,116,117,129,131,120,121,122,123,124,125,126,127, // 112..127
|
||||
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 128..143
|
||||
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,137, // 144..159
|
||||
@ -164,7 +181,33 @@ namespace MobiusEditor.RedAlert
|
||||
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // 192..207
|
||||
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // 208..223
|
||||
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // 224..239
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Fix for the fact the DOS graphics of Einstein use the Mobius graphics.
|
||||
/// 014 => 120
|
||||
/// 130 => 138
|
||||
/// 131 => 119
|
||||
/// </summary>
|
||||
public static byte[] RemapEins = {
|
||||
000,001,002,003,004,005,006,007,008,009,010,011,012,013,120,015, // 000..015
|
||||
016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031, // 016..031
|
||||
032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047, // 032..047
|
||||
048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063, // 048..063
|
||||
064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079, // 064..079
|
||||
080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095, // 080..095
|
||||
096,097,098,099,100,101,102,103,104,105,106,107,108,109,110,111, // 096..111
|
||||
112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, // 112..127
|
||||
128,129,138,119,132,133,134,135,136,137,138,139,140,141,142,143, // 128..143
|
||||
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 144..159
|
||||
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // 160..175
|
||||
176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, // 176..191
|
||||
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // 192..207
|
||||
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // 208..223
|
||||
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // 224..239
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ namespace MobiusEditor.RedAlert
|
||||
public static readonly InfantryType C8 = new InfantryType(18, "c8", "TEXT_UNIT_TITLE_CIV8", "Neutral", "c1", InfantryClassicRemap.RemapCiv8, UnitTypeFlag.NoRemap);
|
||||
public static readonly InfantryType C9 = new InfantryType(19, "c9", "TEXT_UNIT_TITLE_CIV9", "Neutral", "c1", InfantryClassicRemap.RemapCiv9, UnitTypeFlag.NoRemap);
|
||||
public static readonly InfantryType C10 = new InfantryType(20, "c10", "TEXT_UNIT_RA_SCIENTIST", "Neutral", "c1", InfantryClassicRemap.RemapCiv10, UnitTypeFlag.NoRemap);
|
||||
public static readonly InfantryType Einstein = new InfantryType(21, "einstein", "TEXT_UNIT_RA_EINSTEIN", "Neutral", UnitTypeFlag.NoRemap);
|
||||
public static readonly InfantryType Einstein = new InfantryType(21, "einstein", "TEXT_UNIT_RA_EINSTEIN", "Neutral", "einstein", InfantryClassicRemap.RemapEins, UnitTypeFlag.NoRemap);
|
||||
public static readonly InfantryType Delphi = new InfantryType(22, "delphi", "TEXT_UNIT_RA_DELPHI", "Neutral", UnitTypeFlag.IsArmed | UnitTypeFlag.NoRemap);
|
||||
public static readonly InfantryType DrChan = new InfantryType(23, "chan", "TEXT_UNIT_TITLE_CHAN", "Neutral", UnitTypeFlag.NoRemap);
|
||||
public static readonly InfantryType ShockTrooper = new InfantryType(24, "shok", "TEXT_UNIT_RA_SHOK", "USSR", UnitTypeFlag.IsArmed | UnitTypeFlag.IsExpansionUnit);
|
||||
|
@ -415,15 +415,41 @@ namespace MobiusEditor.Render
|
||||
if ((layers & MapLayerFlag.Waypoints) != MapLayerFlag.None)
|
||||
{
|
||||
// todo avoid overlapping waypoints of the same type?
|
||||
Dictionary<int, int> flagOverlapPoints = new Dictionary<int, int>();
|
||||
HashSet<int> handledPoints = new HashSet<int>();
|
||||
ITeamColor[] flagColors = map.FlagColors;
|
||||
bool isSp = map.BasicSection.SoloMission;
|
||||
int offset = 0;
|
||||
foreach (Waypoint waypoint in map.Waypoints)
|
||||
{
|
||||
if (!waypoint.Point.HasValue || (locations != null && !locations.Contains(waypoint.Point.Value)))
|
||||
if (!waypoint.Point.HasValue || (locations != null && !locations.Contains(waypoint.Point.Value)) || !map.Metrics.GetCell(waypoint.Point.Value, out int cell))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
RenderWaypoint(gameType, map.BasicSection.SoloMission, tileSize, flagColors, waypoint).Item2(graphics);
|
||||
float alpha = 0.5f;
|
||||
if (!isSp && Waypoint.GetMpIdFromFlag(waypoint.Flag) != -1)
|
||||
{
|
||||
// Flags are always opaque
|
||||
alpha = 1.0f;
|
||||
if (!flagOverlapPoints.TryGetValue(cell, out int amount))
|
||||
{
|
||||
flagOverlapPoints.Add(cell, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
flagOverlapPoints[cell] = amount + 1;
|
||||
}
|
||||
offset = amount * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (handledPoints.Contains(cell))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
handledPoints.Add(cell);
|
||||
}
|
||||
RenderWaypoint(gameType, isSp, tileSize, flagColors, waypoint, alpha, offset).Item2(graphics);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -441,20 +467,7 @@ namespace MobiusEditor.Render
|
||||
return (Rectangle.Empty, (g) => { });
|
||||
}
|
||||
Color tint = smudge.Tint;
|
||||
ImageAttributes imageAttributes = new ImageAttributes();
|
||||
if (tint != Color.White)
|
||||
{
|
||||
ColorMatrix colorMatrix = new ColorMatrix(new float[][]
|
||||
{
|
||||
new float[] {tint.R / 255.0f, 0, 0, 0, 0},
|
||||
new float[] {0, tint.G / 255.0f, 0, 0, 0},
|
||||
new float[] {0, 0, tint.B / 255.0f, 0, 0},
|
||||
new float[] {0, 0, 0, tint.A / 255.0f, 0},
|
||||
new float[] {0, 0, 0, 0, 1},
|
||||
}
|
||||
);
|
||||
imageAttributes.SetColorMatrix(colorMatrix);
|
||||
}
|
||||
|
||||
bool success = Globals.TheTilesetManager.GetTileData(smudge.Type.Name, smudge.Icon, out Tile tile, true, false);
|
||||
if (tile != null && tile.Image != null)
|
||||
{
|
||||
@ -470,7 +483,14 @@ namespace MobiusEditor.Render
|
||||
}
|
||||
void render(Graphics g)
|
||||
{
|
||||
g.DrawImage(tile.Image, smudgeBounds, 0, 0, tile.Image.Width, tile.Image.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
using (ImageAttributes imageAttributes = new ImageAttributes())
|
||||
{
|
||||
if (tint != Color.White)
|
||||
{
|
||||
imageAttributes.SetColorMatrix(GetColorMatrix(tint, 1.0f, 1.0f));
|
||||
}
|
||||
g.DrawImage(tile.Image, smudgeBounds, 0, 0, tile.Image.Width, tile.Image.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
}
|
||||
return (smudgeBounds, render);
|
||||
}
|
||||
@ -480,6 +500,7 @@ namespace MobiusEditor.Render
|
||||
return (Rectangle.Empty, (g) => { });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static (Rectangle, Action<Graphics>) RenderOverlay(GameType gameType, Point topLeft, Size tileSize, double tileScale, Overlay overlay)
|
||||
{
|
||||
@ -496,39 +517,30 @@ namespace MobiusEditor.Render
|
||||
overlayBounds.X += actualTopLeftX;
|
||||
overlayBounds.Y += actualTopLeftY;
|
||||
Color tint = overlay.Tint;
|
||||
// unused atm
|
||||
Single brightness = 1.0f;
|
||||
void render(Graphics g)
|
||||
{
|
||||
ImageAttributes imageAttributes = new ImageAttributes();
|
||||
if (tint != Color.White || brightness != 1.0f)
|
||||
using (ImageAttributes imageAttributes = new ImageAttributes())
|
||||
{
|
||||
ColorMatrix colorMatrix = new ColorMatrix(new float[][]
|
||||
if (tint != Color.White)
|
||||
{
|
||||
new float[] {tint.R * brightness / 255.0f, 0, 0, 0, 0},
|
||||
new float[] {0, tint.G * brightness / 255.0f, 0, 0, 0},
|
||||
new float[] {0, 0, tint.B * brightness / 255.0f, 0, 0},
|
||||
new float[] {0, 0, 0, tint.A / 255.0f, 0},
|
||||
new float[] {0, 0, 0, 0, 1},
|
||||
imageAttributes.SetColorMatrix(GetColorMatrix(tint, 1.0f, 1.0f));
|
||||
}
|
||||
);
|
||||
imageAttributes.SetColorMatrix(colorMatrix);
|
||||
}
|
||||
g.DrawImage(tile.Image, overlayBounds, 0, 0, tile.Image.Width, tile.Image.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
if (isTeleport)
|
||||
{
|
||||
// Transform ROAD tile into the teleport from SS.
|
||||
int blackBorderX = Math.Max(1, tileSize.Width / 24);
|
||||
int blackBorderY = Math.Max(1, tileSize.Height / 24);
|
||||
int blueWidth = tileSize.Width - blackBorderX * 2;
|
||||
int blueHeight = tileSize.Height - blackBorderY * 2;
|
||||
int blackWidth = tileSize.Width - blackBorderX * 4;
|
||||
int blackHeight = tileSize.Height - blackBorderY * 4;
|
||||
using (SolidBrush blue = new SolidBrush(Color.FromArgb(92, 164, 200)))
|
||||
using (SolidBrush black = new SolidBrush(Color.Black))
|
||||
g.DrawImage(tile.Image, overlayBounds, 0, 0, tile.Image.Width, tile.Image.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
if (isTeleport)
|
||||
{
|
||||
g.FillRectangle(blue, actualTopLeftX + blackBorderX, actualTopLeftY + blackBorderY, blueWidth, blueHeight);
|
||||
g.FillRectangle(black, actualTopLeftX + blackBorderX * 2, actualTopLeftY + blackBorderY * 2, blackWidth, blackHeight);
|
||||
// Transform ROAD tile into the teleport from SS.
|
||||
int blackBorderX = Math.Max(1, tileSize.Width / 24);
|
||||
int blackBorderY = Math.Max(1, tileSize.Height / 24);
|
||||
int blueWidth = tileSize.Width - blackBorderX * 2;
|
||||
int blueHeight = tileSize.Height - blackBorderY * 2;
|
||||
int blackWidth = tileSize.Width - blackBorderX * 4;
|
||||
int blackHeight = tileSize.Height - blackBorderY * 4;
|
||||
using (SolidBrush blue = new SolidBrush(Color.FromArgb(92, 164, 200)))
|
||||
using (SolidBrush black = new SolidBrush(Color.Black))
|
||||
{
|
||||
g.FillRectangle(blue, actualTopLeftX + blackBorderX, actualTopLeftY + blackBorderY, blueWidth, blueHeight);
|
||||
g.FillRectangle(black, actualTopLeftX + blackBorderX * 2, actualTopLeftY + blackBorderY * 2, blackWidth, blackHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -553,19 +565,7 @@ namespace MobiusEditor.Render
|
||||
}
|
||||
}
|
||||
Color tint = terrain.Tint;
|
||||
ImageAttributes imageAttributes = new ImageAttributes();
|
||||
if (tint != Color.White)
|
||||
{
|
||||
ColorMatrix colorMatrix = new ColorMatrix(new float[][]
|
||||
{
|
||||
new float[] {tint.R / 255.0f, 0, 0, 0, 0},
|
||||
new float[] {0, tint.G / 255.0f, 0, 0, 0},
|
||||
new float[] {0, 0, tint.B / 255.0f, 0, 0},
|
||||
new float[] {0, 0, 0, tint.A / 255.0f, 0},
|
||||
new float[] {0, 0, 0, 0, 1},
|
||||
});
|
||||
imageAttributes.SetColorMatrix(colorMatrix);
|
||||
}
|
||||
|
||||
Size terrTSize = terrain.Type.Size;
|
||||
Size tileISize = tile.Image.Size;
|
||||
Point location = new Point(topLeft.X * tileSize.Width, topLeft.Y * tileSize.Height);
|
||||
@ -585,7 +585,14 @@ namespace MobiusEditor.Render
|
||||
Rectangle terrainBounds = new Rectangle(location, maxSize);
|
||||
void render(Graphics g)
|
||||
{
|
||||
g.DrawImage(tile.Image, paintBounds, 0, 0, tile.Image.Width, tile.Image.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
using (ImageAttributes imageAttributes = new ImageAttributes())
|
||||
{
|
||||
if (tint != Color.White)
|
||||
{
|
||||
imageAttributes.SetColorMatrix(GetColorMatrix(tint, 1.0f, 1.0f));
|
||||
}
|
||||
g.DrawImage(tile.Image, paintBounds, 0, 0, tile.Image.Width, tile.Image.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
}
|
||||
Point centerPoint = GetTerrainRenderPoint(terrain);
|
||||
Point usedCenter = new Point(topLeft.X * Globals.PixelWidth + centerPoint.X, topLeft.Y * Globals.PixelHeight + centerPoint.Y);
|
||||
@ -668,48 +675,41 @@ namespace MobiusEditor.Render
|
||||
}
|
||||
void render(Graphics g)
|
||||
{
|
||||
ImageAttributes imageAttributes = new ImageAttributes();
|
||||
if (tint != Color.White)
|
||||
using (ImageAttributes imageAttributes = new ImageAttributes())
|
||||
{
|
||||
ColorMatrix colorMatrix = new ColorMatrix(new float[][]
|
||||
if (tint != Color.White)
|
||||
{
|
||||
new float[] {tint.R / 255.0f, 0, 0, 0, 0},
|
||||
new float[] {0, tint.G / 255.0f, 0, 0, 0},
|
||||
new float[] {0, 0, tint.B / 255.0f, 0, 0},
|
||||
new float[] {0, 0, 0, tint.A / 255.0f, 0},
|
||||
new float[] {0, 0, 0, 0, 1},
|
||||
imageAttributes.SetColorMatrix(GetColorMatrix(tint, 1.0f, 1.0f));
|
||||
}
|
||||
);
|
||||
imageAttributes.SetColorMatrix(colorMatrix);
|
||||
}
|
||||
if (factoryOverlayTile != null)
|
||||
{
|
||||
// Avoid overlay showing as semiitransparent.
|
||||
using (Bitmap factory = new Bitmap(maxSize.Width, maxSize.Height))
|
||||
if (factoryOverlayTile != null)
|
||||
{
|
||||
factory.SetResolution(96, 96);
|
||||
using (Graphics factoryG = Graphics.FromImage(factory))
|
||||
// Avoid factory overlay showing as semitransparent.
|
||||
using (Bitmap factory = new Bitmap(maxSize.Width, maxSize.Height))
|
||||
{
|
||||
factoryG.CopyRenderSettingsFrom(g);
|
||||
Size renderSize = tileISize;
|
||||
if (!succeeded)
|
||||
factory.SetResolution(96, 96);
|
||||
using (Graphics factoryG = Graphics.FromImage(factory))
|
||||
{
|
||||
renderSize.Width = building.Type.Size.Width * tileSize.Width;
|
||||
renderSize.Height = building.Type.Size.Height * tileSize.Height;
|
||||
factoryG.CopyRenderSettingsFrom(g);
|
||||
Size renderSize = tileISize;
|
||||
if (!succeeded)
|
||||
{
|
||||
renderSize.Width = building.Type.Size.Width * tileSize.Width;
|
||||
renderSize.Height = building.Type.Size.Height * tileSize.Height;
|
||||
}
|
||||
Rectangle factBounds = RenderBounds(renderSize, building.Type.Size, tileScale);
|
||||
Rectangle ovrlBounds = RenderBounds(factoryOverlayTile.Image.Size, building.Type.Size, tileScale);
|
||||
factoryG.DrawImage(tile.Image, factBounds, 0, 0, tile.Image.Width, tile.Image.Height, GraphicsUnit.Pixel);
|
||||
factoryG.DrawImage(factoryOverlayTile.Image, ovrlBounds, 0, 0, factoryOverlayTile.Image.Width, factoryOverlayTile.Image.Height, GraphicsUnit.Pixel);
|
||||
}
|
||||
Rectangle factBounds = RenderBounds(renderSize, building.Type.Size, tileScale);
|
||||
Rectangle ovrlBounds = RenderBounds(factoryOverlayTile.Image.Size, building.Type.Size, tileScale);
|
||||
factoryG.DrawImage(tile.Image, factBounds, 0, 0, tile.Image.Width, tile.Image.Height, GraphicsUnit.Pixel);
|
||||
factoryG.DrawImage(factoryOverlayTile.Image, ovrlBounds, 0, 0, factoryOverlayTile.Image.Width, factoryOverlayTile.Image.Height, GraphicsUnit.Pixel);
|
||||
g.DrawImage(factory, buildingBounds, 0, 0, factory.Width, factory.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
g.DrawImage(factory, buildingBounds, 0, 0, factory.Width, factory.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
paintBounds.X += location.X;
|
||||
paintBounds.Y += location.Y;
|
||||
g.DrawImage(tile.Image, paintBounds, 0, 0, tile.Image.Width, tile.Image.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
else
|
||||
{
|
||||
paintBounds.X += location.X;
|
||||
paintBounds.Y += location.Y;
|
||||
g.DrawImage(tile.Image, paintBounds, 0, 0, tile.Image.Width, tile.Image.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
}
|
||||
}
|
||||
Point centerPoint = GetBuildingRenderPoint(building);
|
||||
@ -764,35 +764,28 @@ namespace MobiusEditor.Render
|
||||
Color tint = infantry.Tint;
|
||||
void render(Graphics g)
|
||||
{
|
||||
ImageAttributes imageAttributes = new ImageAttributes();
|
||||
if (tint != Color.White)
|
||||
using (ImageAttributes imageAttributes = new ImageAttributes())
|
||||
{
|
||||
ColorMatrix colorMatrix = new ColorMatrix(new float[][]
|
||||
if (tint != Color.White)
|
||||
{
|
||||
new float[] {tint.R / 255.0f, 0, 0, 0, 0},
|
||||
new float[] {0, tint.G / 255.0f, 0, 0, 0},
|
||||
new float[] {0, 0, tint.B / 255.0f, 0, 0},
|
||||
new float[] {0, 0, 0, tint.A / 255.0f, 0},
|
||||
new float[] {0, 0, 0, 0, 1},
|
||||
imageAttributes.SetColorMatrix(GetColorMatrix(tint, 1.0f, 1.0f));
|
||||
}
|
||||
);
|
||||
imageAttributes.SetColorMatrix(colorMatrix);
|
||||
g.DrawImage(tile.Image, renderBounds, 0, 0, tile.Image.Width, tile.Image.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
// Test code to visualise original 5-point die face location (green), and corrected infantry base point (feet) location (red).
|
||||
/*/
|
||||
Size pixel = new Size(tileSize.Width / Globals.PixelWidth, tileSize.Height / Globals.PixelHeight);
|
||||
using (SolidBrush sb = new SolidBrush(Color.Red))
|
||||
{
|
||||
g.FillRectangle(sb, new Rectangle(renderLocation, pixel));
|
||||
}
|
||||
using (SolidBrush sb = new SolidBrush(Color.LimeGreen))
|
||||
{
|
||||
g.FillRectangle(sb, new Rectangle(new Point(
|
||||
origLocation.X + offsetBare.X * tileSize.Width / Globals.PixelWidth,
|
||||
origLocation.Y + (offsetBare.Y * tileSize.Height / Globals.PixelHeight)), pixel));
|
||||
}
|
||||
//*/
|
||||
}
|
||||
g.DrawImage(tile.Image, renderBounds, 0, 0, tile.Image.Width, tile.Image.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
// Test code to visualise original 5-point die face location (green), and corrected infantry base point (feet) location (red).
|
||||
/*/
|
||||
Size pixel = new Size(tileSize.Width / Globals.PixelWidth, tileSize.Height / Globals.PixelHeight);
|
||||
using (SolidBrush sb = new SolidBrush(Color.Red))
|
||||
{
|
||||
g.FillRectangle(sb, new Rectangle(renderLocation, pixel));
|
||||
}
|
||||
using (SolidBrush sb = new SolidBrush(Color.LimeGreen))
|
||||
{
|
||||
g.FillRectangle(sb, new Rectangle(new Point(
|
||||
origLocation.X + offsetBare.X * tileSize.Width / Globals.PixelWidth,
|
||||
origLocation.Y + (offsetBare.Y * tileSize.Height / Globals.PixelHeight)), pixel));
|
||||
}
|
||||
//*/
|
||||
}
|
||||
// Render position is the feet point, adjusted to 24-pixel cell location.
|
||||
return new RenderInfo(new Point(topLeft.X * Globals.PixelWidth + offset.X, topLeft.Y * Globals.PixelHeight + offset.Y), render, false, infantry);
|
||||
@ -939,103 +932,97 @@ namespace MobiusEditor.Render
|
||||
Color tint = unit.Tint;
|
||||
void render(Graphics g)
|
||||
{
|
||||
ImageAttributes imageAttributes = new ImageAttributes();
|
||||
if (tint != Color.White)
|
||||
using (ImageAttributes imageAttributes = new ImageAttributes())
|
||||
{
|
||||
ColorMatrix colorMatrix = new ColorMatrix(new float[][]
|
||||
if (tint != Color.White)
|
||||
{
|
||||
new float[] {tint.R / 255.0f, 0, 0, 0, 0},
|
||||
new float[] {0, tint.G / 255.0f, 0, 0, 0},
|
||||
new float[] {0, 0, tint.B / 255.0f, 0, 0},
|
||||
new float[] {0, 0, 0, tint.A / 255.0f, 0},
|
||||
new float[] {0, 0, 0, 0, 1},
|
||||
imageAttributes.SetColorMatrix(GetColorMatrix(tint, 1.0f, 1.0f));
|
||||
}
|
||||
);
|
||||
imageAttributes.SetColorMatrix(colorMatrix);
|
||||
}
|
||||
// Combine body and turret to one image, then paint it. This is done because it might be semitransparent.
|
||||
using (Bitmap unitBm = new Bitmap(renderBounds.Width, renderBounds.Height))
|
||||
{
|
||||
unitBm.SetResolution(96, 96);
|
||||
using (Graphics unitG = Graphics.FromImage(unitBm))
|
||||
// Combine body and turret to one image, then paint it. This is done because it might be semitransparent.
|
||||
using (Bitmap unitBm = new Bitmap(renderBounds.Width, renderBounds.Height))
|
||||
{
|
||||
unitG.CopyRenderSettingsFrom(g);
|
||||
if (tile != null) {
|
||||
unitG.DrawImage(tile.Image, renderRect, 0, 0, tile.Image.Width, tile.Image.Height, GraphicsUnit.Pixel);
|
||||
}
|
||||
if (unit.Type.HasTurret)
|
||||
unitBm.SetResolution(96, 96);
|
||||
using (Graphics unitG = Graphics.FromImage(unitBm))
|
||||
{
|
||||
Point turretAdjust = Point.Empty;
|
||||
Point turret2Adjust = Point.Empty;
|
||||
|
||||
if (unit.Type.TurretOffset == Int32.MaxValue)
|
||||
unitG.CopyRenderSettingsFrom(g);
|
||||
if (tile != null)
|
||||
{
|
||||
// Special case: MaxValue indicates the turret oFfset is determined by the TurretAdjustOffset table.
|
||||
turretAdjust = BackTurretAdjust[Facing32[unit.Direction.ID]];
|
||||
unitG.DrawImage(tile.Image, renderRect, 0, 0, tile.Image.Width, tile.Image.Height, GraphicsUnit.Pixel);
|
||||
}
|
||||
if (unit.Type.HasTurret)
|
||||
{
|
||||
Point turretAdjust = Point.Empty;
|
||||
Point turret2Adjust = Point.Empty;
|
||||
|
||||
if (unit.Type.TurretOffset == Int32.MaxValue)
|
||||
{
|
||||
// Special case: MaxValue indicates the turret oFfset is determined by the TurretAdjustOffset table.
|
||||
turretAdjust = BackTurretAdjust[Facing32[unit.Direction.ID]];
|
||||
if (unit.Type.HasDoubleTurret)
|
||||
{
|
||||
// Never actually used for 2 turrets.
|
||||
turret2Adjust = BackTurretAdjust[Facing32[(byte)((unit.Direction.ID + DirectionTypes.South.ID) & 0xFF)]];
|
||||
}
|
||||
}
|
||||
else if (unit.Type.TurretOffset != 0)
|
||||
{
|
||||
// Used by ships and by the transport helicopter.
|
||||
int distance = unit.Type.TurretOffset;
|
||||
int face = (unit.Direction.ID >> 5) & 7;
|
||||
if (unit.Type.IsAircraft)
|
||||
{
|
||||
// Stretch distance is given by a table.
|
||||
distance *= HeliDistanceAdjust[face];
|
||||
}
|
||||
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
// For vessels, perspective stretch is simply done as '/ 2'.
|
||||
int perspectiveDivide = unit.Type.IsVessel ? 2 : 1;
|
||||
MovePoint(ref x, ref y, unit.Direction.ID, distance, perspectiveDivide);
|
||||
turretAdjust.X = x;
|
||||
turretAdjust.Y = y;
|
||||
if (unit.Type.HasDoubleTurret)
|
||||
{
|
||||
x = 0;
|
||||
y = 0;
|
||||
MovePoint(ref x, ref y, (byte)((unit.Direction.ID + DirectionTypes.South.ID) & 0xFF), distance, perspectiveDivide);
|
||||
turret2Adjust.X = x;
|
||||
turret2Adjust.Y = y;
|
||||
}
|
||||
}
|
||||
// Adjust Y-offset.
|
||||
turretAdjust.Y += unit.Type.TurretY;
|
||||
if (unit.Type.HasDoubleTurret)
|
||||
{
|
||||
// Never actually used for 2 turrets.
|
||||
turret2Adjust = BackTurretAdjust[Facing32[(byte)((unit.Direction.ID + DirectionTypes.South.ID) & 0xFF)]];
|
||||
turret2Adjust.Y += unit.Type.TurretY;
|
||||
}
|
||||
}
|
||||
else if (unit.Type.TurretOffset != 0)
|
||||
{
|
||||
// Used by ships and by the transport helicopter.
|
||||
int distance = unit.Type.TurretOffset;
|
||||
int face = (unit.Direction.ID >> 5) & 7;
|
||||
if (unit.Type.IsAircraft)
|
||||
Point center = new Point(renderBounds.Width / 2, renderBounds.Height / 2);
|
||||
|
||||
void RenderTurret(Graphics ug, Tile turrTile, Point turrAdjust, Size tSize)
|
||||
{
|
||||
// Stretch distance is given by a table.
|
||||
distance *= HeliDistanceAdjust[face];
|
||||
Size turretSize = turrTile.Image.Size;
|
||||
Size turretRenderSize = new Size(turretSize.Width * tSize.Width / Globals.OriginalTileWidth, turretSize.Height * tSize.Height / Globals.OriginalTileHeight);
|
||||
Rectangle turrBounds = new Rectangle(center - new Size(turretRenderSize.Width / 2, turretRenderSize.Height / 2), turretRenderSize);
|
||||
turrBounds.Offset(
|
||||
turrAdjust.X * tSize.Width / Globals.PixelWidth,
|
||||
turrAdjust.Y * tSize.Height / Globals.PixelHeight
|
||||
);
|
||||
ug.DrawImage(turrTile.Image, turrBounds, 0, 0, turrTile.Image.Width, turrTile.Image.Height, GraphicsUnit.Pixel);
|
||||
}
|
||||
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
// For vessels, perspective stretch is simply done as '/ 2'.
|
||||
int perspectiveDivide = unit.Type.IsVessel ? 2 : 1;
|
||||
MovePoint(ref x, ref y, unit.Direction.ID, distance, perspectiveDivide);
|
||||
turretAdjust.X = x;
|
||||
turretAdjust.Y = y;
|
||||
if (unit.Type.HasDoubleTurret)
|
||||
if (turretTile != null && turretTile.Image != null)
|
||||
{
|
||||
x = 0;
|
||||
y = 0;
|
||||
MovePoint(ref x, ref y, (byte)((unit.Direction.ID + DirectionTypes.South.ID) & 0xFF), distance, perspectiveDivide);
|
||||
turret2Adjust.X = x;
|
||||
turret2Adjust.Y = y;
|
||||
RenderTurret(unitG, turretTile, turretAdjust, tileSize);
|
||||
}
|
||||
if (unit.Type.HasDoubleTurret && turret2Tile != null && turret2Tile.Image != null)
|
||||
{
|
||||
RenderTurret(unitG, turret2Tile, turret2Adjust, tileSize);
|
||||
}
|
||||
}
|
||||
// Adjust Y-offset.
|
||||
turretAdjust.Y += unit.Type.TurretY;
|
||||
if (unit.Type.HasDoubleTurret)
|
||||
{
|
||||
turret2Adjust.Y += unit.Type.TurretY;
|
||||
}
|
||||
Point center = new Point(renderBounds.Width / 2, renderBounds.Height / 2);
|
||||
|
||||
void RenderTurret(Graphics ug, Tile turrTile, Point turrAdjust, Size tSize)
|
||||
{
|
||||
Size turretSize = turrTile.Image.Size;
|
||||
Size turretRenderSize = new Size(turretSize.Width * tSize.Width / Globals.OriginalTileWidth, turretSize.Height * tSize.Height / Globals.OriginalTileHeight);
|
||||
Rectangle turrBounds = new Rectangle(center - new Size(turretRenderSize.Width / 2, turretRenderSize.Height / 2), turretRenderSize);
|
||||
turrBounds.Offset(
|
||||
turrAdjust.X * tSize.Width / Globals.PixelWidth,
|
||||
turrAdjust.Y * tSize.Height / Globals.PixelHeight
|
||||
);
|
||||
ug.DrawImage(turrTile.Image, turrBounds, 0, 0, turrTile.Image.Width, turrTile.Image.Height, GraphicsUnit.Pixel);
|
||||
}
|
||||
|
||||
if (turretTile != null && turretTile.Image != null)
|
||||
{
|
||||
RenderTurret(unitG, turretTile, turretAdjust, tileSize);
|
||||
}
|
||||
if (unit.Type.HasDoubleTurret && turret2Tile != null && turret2Tile.Image != null)
|
||||
{
|
||||
RenderTurret(unitG, turret2Tile, turret2Adjust, tileSize);
|
||||
}
|
||||
}
|
||||
g.DrawImage(unitBm, renderBounds, 0, 0, renderBounds.Width, renderBounds.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
g.DrawImage(unitBm, renderBounds, 0,0, renderBounds.Width, renderBounds.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
}
|
||||
Point centerPoint = GetVehicleRenderPoint();
|
||||
@ -1043,16 +1030,7 @@ namespace MobiusEditor.Render
|
||||
return new RenderInfo(usedCenter, render, false, unit);
|
||||
}
|
||||
|
||||
public static (Rectangle, Action<Graphics>) RenderWaypoint(GameType gameType, bool soloMission, Size tileSize, ITeamColor[] flagColors, Waypoint waypoint)
|
||||
{
|
||||
// Opacity is normally 0.5 for non-flag waypoint indicators, but is variable because the post-render
|
||||
// actions of the waypoints tool will paint a fully opaque version over the currently selected waypoint.
|
||||
//int mpId = Waypoint.GetMpIdFromFlag(waypoint.Flag);
|
||||
//float defaultOpacity = !soloMission && mpId >= 0 && mpId < flagColors.Length ? 1.0f : 0.5f;
|
||||
return RenderWaypoint(gameType, soloMission, tileSize, flagColors, waypoint, 0.5f);
|
||||
}
|
||||
|
||||
public static (Rectangle, Action<Graphics>) RenderWaypoint(GameType gameType, bool soloMission, Size tileSize, ITeamColor[] flagColors, Waypoint waypoint, float transparencyModifier)
|
||||
public static (Rectangle, Action<Graphics>) RenderWaypoint(GameType gameType, bool soloMission, Size tileSize, ITeamColor[] flagColors, Waypoint waypoint, float transparencyModifier, int offset)
|
||||
{
|
||||
if (!waypoint.Point.HasValue)
|
||||
{
|
||||
@ -1065,7 +1043,6 @@ namespace MobiusEditor.Render
|
||||
ITeamColor teamColor = null;
|
||||
double sizeMultiplier = 1;
|
||||
Color tint = waypoint.Tint;
|
||||
float brightness = 1.0f;
|
||||
int mpId = Waypoint.GetMpIdFromFlag(waypoint.Flag);
|
||||
bool gotTile = false;
|
||||
Tile tile;
|
||||
@ -1076,7 +1053,7 @@ namespace MobiusEditor.Render
|
||||
icon = 0;
|
||||
teamColor = flagColors[mpId];
|
||||
// Always paint flags as opaque.
|
||||
transparencyModifier = 1.0f;
|
||||
//transparencyModifier = 1.0f;
|
||||
gotTile = Globals.TheTilesetManager.GetTeamColorTileData(tileGraphics, icon, teamColor, out tile);
|
||||
}
|
||||
else if (gameType == GameType.SoleSurvivor && (waypoint.Flag & WaypointFlag.CrateSpawn) == WaypointFlag.CrateSpawn)
|
||||
@ -1136,23 +1113,33 @@ namespace MobiusEditor.Render
|
||||
imgBounds.Height = (int)Math.Round(tileSize.Height / sizeMultiplier);
|
||||
imgBounds.Y = (tile.Image.Height - imgBounds.Height) / 2;
|
||||
}
|
||||
// Apply offset
|
||||
int actualOffsetX = offset * tileSize.Width / Globals.PixelWidth;
|
||||
int actualOffsetY = offset * tileSize.Height / Globals.PixelHeight;
|
||||
renderBounds.X += actualOffsetX;
|
||||
renderBounds.Y += actualOffsetY;
|
||||
renderBounds.Width = Math.Max(0, renderBounds.Width - actualOffsetX);
|
||||
renderBounds.Height = Math.Max(0, renderBounds.Height - actualOffsetY);
|
||||
// Optional: crop the image. If not, it scales, which also looks okay
|
||||
//int imageOffsetX = (int)(tile.Image.Width * sizeMultiplier * offset / Globals.PixelWidth);
|
||||
//int imageOffsetY = (int)(tile.Image.Height * sizeMultiplier * offset / Globals.PixelWidth);
|
||||
//imgBounds.Width = Math.Max(0, imgBounds.Width - imageOffsetX);
|
||||
//imgBounds.Height = Math.Max(0, imgBounds.Height - imageOffsetY);
|
||||
|
||||
void render(Graphics g)
|
||||
{
|
||||
ImageAttributes imageAttributes = new ImageAttributes();
|
||||
// Waypoints get drawn as semitransparent, so always execute this.
|
||||
if (tint != Color.White || brightness != 1.0 || transparencyModifier != 1.0)
|
||||
using (ImageAttributes imageAttributes = new ImageAttributes())
|
||||
{
|
||||
ColorMatrix colorMatrix = new ColorMatrix(new float[][]
|
||||
// Waypoints get drawn as semitransparent, so always execute this.
|
||||
if (tint != Color.White || transparencyModifier != 1.0)
|
||||
{
|
||||
new float[] {tint.R * brightness / 255.0f, 0, 0, 0, 0},
|
||||
new float[] {0, tint.G * brightness / 255.0f, 0, 0, 0},
|
||||
new float[] {0, 0, tint.B * brightness / 255.0f, 0, 0},
|
||||
new float[] {0, 0, 0, (tint.A * transparencyModifier) / 255.0f, 0},
|
||||
new float[] {0, 0, 0, 0, 1},
|
||||
});
|
||||
imageAttributes.SetColorMatrix(colorMatrix);
|
||||
imageAttributes.SetColorMatrix(GetColorMatrix(tint, 1.0f, transparencyModifier));
|
||||
}
|
||||
if (renderBounds.Width > 0 && renderBounds.Height > 0 && imgBounds.Width > 0 && imgBounds.Height > 0)
|
||||
{
|
||||
g.DrawImage(tile.Image, renderBounds, imgBounds.X, imgBounds.Y, imgBounds.Width, imgBounds.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
}
|
||||
g.DrawImage(tile.Image, renderBounds, imgBounds.X, imgBounds.Y, imgBounds.Width, imgBounds.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
return (renderBounds, render);
|
||||
}
|
||||
@ -1635,7 +1622,7 @@ namespace MobiusEditor.Render
|
||||
ITeamColor[] flagColors = map.FlagColors;
|
||||
foreach (Waypoint wp in footballWayPoints)
|
||||
{
|
||||
RenderWaypoint(gameType, false, tileSize, flagColors, wp).Item2(graphics);
|
||||
RenderWaypoint(gameType, false, tileSize, flagColors, wp, 1.0f, 0).Item2(graphics);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2436,13 +2423,6 @@ namespace MobiusEditor.Render
|
||||
if (Globals.TheTilesetManager.GetTileData("trans.icn", 0, out tile) && tile != null) bmWtr = tile.Image; // white
|
||||
try
|
||||
{
|
||||
var colorMatrix = new ColorMatrix();
|
||||
colorMatrix.Matrix33 = 0.50f;
|
||||
var imageAttributes = new ImageAttributes();
|
||||
imageAttributes.SetColorMatrix(
|
||||
colorMatrix,
|
||||
ColorMatrixFlag.Default,
|
||||
ColorAdjustType.Bitmap);
|
||||
// If the graphics could not be loaded from the clasic files, generate them.
|
||||
if (bmImp == null && cellsVehImpassable.Count > 0)
|
||||
{
|
||||
@ -2477,22 +2457,26 @@ namespace MobiusEditor.Render
|
||||
bgr.FillRegion(blueBrush, blueArea);
|
||||
}
|
||||
}
|
||||
// Finally, paint the actual cells.
|
||||
foreach ((int x, int y) in cellsVehImpassable)
|
||||
using (ImageAttributes imageAttributes = new ImageAttributes())
|
||||
{
|
||||
graphics.DrawImage(bmImp, new Rectangle(tileWidth * x, tileHeight * y, tileWidth, tileHeight), 0, 0, bmImp.Width, bmImp.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
foreach ((int x, int y) in cellsUnbuildable)
|
||||
{
|
||||
graphics.DrawImage(bmUnb, new Rectangle(tileWidth * x, tileHeight * y, tileWidth, tileHeight), 0, 0, bmUnb.Width, bmUnb.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
foreach ((int x, int y) in cellsBoatMovable)
|
||||
{
|
||||
graphics.DrawImage(bmWtr, new Rectangle(tileWidth * x, tileHeight * y, tileWidth, tileHeight), 0, 0, bmWtr.Width, bmWtr.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
foreach ((int x, int y) in cellsRiver)
|
||||
{
|
||||
graphics.DrawImage(bmRiv, new Rectangle(tileWidth * x, tileHeight * y, tileWidth, tileHeight), 0, 0, bmRiv.Width, bmRiv.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
imageAttributes.SetColorMatrix(GetColorMatrix(Color.White, 1.0f, 0.50f));
|
||||
// Finally, paint the actual cells.
|
||||
foreach ((int x, int y) in cellsVehImpassable)
|
||||
{
|
||||
graphics.DrawImage(bmImp, new Rectangle(tileWidth * x, tileHeight * y, tileWidth, tileHeight), 0, 0, bmImp.Width, bmImp.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
foreach ((int x, int y) in cellsUnbuildable)
|
||||
{
|
||||
graphics.DrawImage(bmUnb, new Rectangle(tileWidth * x, tileHeight * y, tileWidth, tileHeight), 0, 0, bmUnb.Width, bmUnb.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
foreach ((int x, int y) in cellsBoatMovable)
|
||||
{
|
||||
graphics.DrawImage(bmWtr, new Rectangle(tileWidth * x, tileHeight * y, tileWidth, tileHeight), 0, 0, bmWtr.Width, bmWtr.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
foreach ((int x, int y) in cellsRiver)
|
||||
{
|
||||
graphics.DrawImage(bmRiv, new Rectangle(tileWidth * x, tileHeight * y, tileWidth, tileHeight), 0, 0, bmRiv.Width, bmRiv.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
@ -2612,5 +2596,17 @@ namespace MobiusEditor.Render
|
||||
return new Rectangle((int)Math.Round(locX * scaleFactorX), (int)Math.Round(locY * scaleFactorY),
|
||||
Math.Max(1, (int)Math.Round(newSize.Width * scaleFactorX)), Math.Max(1, (int)Math.Round(newSize.Height * scaleFactorY)));
|
||||
}
|
||||
|
||||
private static ColorMatrix GetColorMatrix(Color tint, float brightnessModifier, float alphaModifier)
|
||||
{
|
||||
return new ColorMatrix(new float[][]
|
||||
{
|
||||
new float[] {tint.R * brightnessModifier / 255.0f, 0, 0, 0, 0},
|
||||
new float[] {0, tint.G * brightnessModifier / 255.0f, 0, 0, 0},
|
||||
new float[] {0, 0, tint.B * brightnessModifier / 255.0f, 0, 0},
|
||||
new float[] {0, 0, 0, tint.A * alphaModifier / 255.0f, 0},
|
||||
new float[] {0, 0, 0, 0, 1},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -525,7 +525,7 @@ namespace MobiusEditor.Tools
|
||||
// If the selected waypoint is not a flag, re-render it as opaque.
|
||||
if (selected != null && (plugin.Map.BasicSection.SoloMission || (selected.Flag & WaypointFlag.PlayerStart) != WaypointFlag.PlayerStart))
|
||||
{
|
||||
MapRenderer.RenderWaypoint(plugin.GameType, true, Globals.MapTileSize, map.FlagColors.ToArray(), selected, 1.0f).Item2(graphics);
|
||||
MapRenderer.RenderWaypoint(plugin.GameType, true, Globals.MapTileSize, map.FlagColors.ToArray(), selected, 1.0f, 0).Item2(graphics);
|
||||
}
|
||||
// Render those here so they are put over the opaque redraw of the current waypoint.
|
||||
MapRenderer.RenderAllTechnoTriggers(graphics, plugin.Map, visibleCells, Globals.MapTileSize, Layers);
|
||||
|
@ -25,12 +25,12 @@ namespace MobiusEditor.Utility
|
||||
return new ListItem<T>(value, Label);
|
||||
}
|
||||
|
||||
public static T GetValueFromDropdown<T>(ComboBox dropdown)
|
||||
public static T GetValueFromComboBox<T>(ComboBox dropdown)
|
||||
{
|
||||
return GetValueFromDropdown(dropdown, default(T));
|
||||
return GetValueFromComboBox(dropdown, default(T));
|
||||
}
|
||||
|
||||
public static T GetValueFromDropdown<T>(ComboBox dropdown, T defaultValue)
|
||||
public static T GetValueFromComboBox<T>(ComboBox dropdown, T defaultValue)
|
||||
{
|
||||
if (dropdown.SelectedItem is ListItem<T> li)
|
||||
{
|
||||
@ -39,6 +39,20 @@ namespace MobiusEditor.Utility
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public static T GetValueFromListBox<T>(ListBox listBox)
|
||||
{
|
||||
return GetValueFromListBox(listBox, default(T));
|
||||
}
|
||||
|
||||
public static T GetValueFromListBox<T>(ListBox listBox, T defaultValue)
|
||||
{
|
||||
if (listBox.SelectedItem is ListItem<T> li)
|
||||
{
|
||||
return li.Value;
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public static int GetIndexInList<T>(T value, ListItem<T>[] items)
|
||||
{
|
||||
return GetIndexInList<T>(value, items, -1);
|
||||
|
@ -82,11 +82,30 @@ namespace MobiusEditor.Utility
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registers an archive to be loaded the next time <see cref="Reset(GameType, TheaterType)"/> is called. This overload does not expose Red Alert's extended options.
|
||||
/// </summary>
|
||||
/// <param name="gameType">Game type to register this mix file for.</param>
|
||||
/// <param name="archivePath">Name of the archive.</param>
|
||||
/// <param name="isTheater">True if this is a Theater archive. This excludes the archive from getting loaded on <see cref="Reset(GameType, TheaterType)"/> when it does not match the specified theater.</param>
|
||||
/// <returns>True if the archive file was found.</returns>
|
||||
/// <exception cref="ObjectDisposedException">The MixFileManager is disposed.</exception>
|
||||
public bool LoadArchive(GameType gameType, String archivePath, bool isTheater)
|
||||
{
|
||||
return this.LoadArchive(gameType, archivePath, isTheater, false, false, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registers an archive to be loaded the next time <see cref="Reset(GameType, TheaterType)"/> is called.
|
||||
/// </summary>
|
||||
/// <param name="gameType">Game type to register this mix file for.</param>
|
||||
/// <param name="archivePath">Name of the archive.</param>
|
||||
/// <param name="isTheater">True if this is a Theater archive. This excludes the archive from getting loaded on <see cref="Reset(GameType, TheaterType)"/> when it does not match the specified theater.</param>
|
||||
/// <param name="isContainer">True if this is a container archive that can contain other archives.</param>
|
||||
/// <param name="canBeEmbedded">True if this archive can be read from inside another archive. Note that it will only be searched inside archives loaded before this one.</param>
|
||||
/// <param name="canUseNewFormat">Allow RA's newer mix file format.</param>
|
||||
/// <returns>True if the archive file was found. Note that if it was not found, it might still be loaded from inside another mix file, but this is only handled on Reset.</returns>
|
||||
/// <exception cref="ObjectDisposedException">The MixFileManager is disposed.</exception>
|
||||
public bool LoadArchive(GameType gameType, String archivePath, bool isTheater, bool isContainer, bool canBeEmbedded, bool canUseNewFormat)
|
||||
{
|
||||
if (disposedValue)
|
||||
@ -119,6 +138,15 @@ namespace MobiusEditor.Utility
|
||||
return canBeEmbedded || File.Exists(fullPath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registers archives with a wildcard to be loaded the next time <see cref="Reset(GameType, TheaterType)"/> is called.
|
||||
/// Will search all available sources for these files, but cannot look inside other .mix files.
|
||||
/// </summary>
|
||||
/// <param name="gameType">Game type to register thee files for.</param>
|
||||
/// <param name="archiveMask">file mask of archive.</param>
|
||||
/// <param name="canUseNewFormat">Allow RA's newer mix file format.</param>
|
||||
/// <returns>The amount of found archives.</returns>
|
||||
/// <exception cref="ObjectDisposedException">The MixFileManager is disposed.</exception>
|
||||
public int LoadArchives(GameType gameType, String archiveMask, bool canUseNewFormat)
|
||||
{
|
||||
if (disposedValue)
|
||||
|
@ -327,12 +327,12 @@ namespace MobiusEditor.Utility
|
||||
mfm.Reset(GameType.TiberianDawn, null);
|
||||
List<string> loadedFiles = mfm.ToList();
|
||||
string prefix = tdSsEqual ? "TD/SS: " : "TD: ";
|
||||
if (!loadedFiles.Contains("local.mix") && !loadedFiles.Contains("cclocal.mix")) loadErrors.Add(prefix + "local.mix / cclocal.mix");
|
||||
if (!loadedFiles.Contains("conquer.mix")) loadErrors.Add(prefix + "conquer.mix");
|
||||
if (!loadedFiles.Contains("desert.mix")) loadErrors.Add(prefix + "desert.mix");
|
||||
if (!loadedFiles.Contains("temperat.mix")) loadErrors.Add(prefix + "temperat.mix");
|
||||
if (!loadedFiles.Contains("winter.mix")) loadErrors.Add(prefix + "winter.mix");
|
||||
if (!mfm.FileExists("conquer.eng")) fileLoadErrors.Add(prefix + "conquer.eng");
|
||||
TestMixExists(loadedFiles, loadErrors, prefix, "local.mix", "cclocal.mix");
|
||||
TestMixExists(loadedFiles, loadErrors, prefix, "conquer.mix");
|
||||
TestMixExists(loadedFiles, loadErrors, prefix, "desert.mix");
|
||||
TestMixExists(loadedFiles, loadErrors, prefix, "temperat.mix");
|
||||
TestMixExists(loadedFiles, loadErrors, prefix, "winter.mix");
|
||||
TestFileExists(mfm, loadErrors, prefix, "conquer.eng");
|
||||
|
||||
// Sole Survivor
|
||||
mfm.LoadArchive(GameType.SoleSurvivor, "local.mix", false);
|
||||
@ -350,12 +350,12 @@ namespace MobiusEditor.Utility
|
||||
mfm.Reset(GameType.SoleSurvivor, null);
|
||||
loadedFiles = mfm.ToList();
|
||||
prefix = "SS: ";
|
||||
if (!loadedFiles.Contains("local.mix") && !loadedFiles.Contains("cclocal.mix")) loadErrors.Add(prefix + "local.mix / cclocal.mix");
|
||||
if (!loadedFiles.Contains("conquer.mix")) loadErrors.Add(prefix + "conquer.mix");
|
||||
if (!loadedFiles.Contains("desert.mix")) loadErrors.Add(prefix + "desert.mix");
|
||||
if (!loadedFiles.Contains("temperat.mix")) loadErrors.Add(prefix + "temperat.mix");
|
||||
if (!loadedFiles.Contains("winter.mix")) loadErrors.Add(prefix + "winter.mix");
|
||||
if (!mfm.FileExists("conquer.eng")) fileLoadErrors.Add(prefix + "conquer.eng");
|
||||
TestMixExists(loadedFiles, loadErrors, prefix, "local.mix", "cclocal.mix");
|
||||
TestMixExists(loadedFiles, loadErrors, prefix, "conquer.mix");
|
||||
TestMixExists(loadedFiles, loadErrors, prefix, "desert.mix");
|
||||
TestMixExists(loadedFiles, loadErrors, prefix, "temperat.mix");
|
||||
TestMixExists(loadedFiles, loadErrors, prefix, "winter.mix");
|
||||
TestFileExists(mfm, loadErrors, prefix, "conquer.eng");
|
||||
}
|
||||
mfm.Reset(GameType.None, null);
|
||||
}
|
||||
@ -363,7 +363,7 @@ namespace MobiusEditor.Utility
|
||||
private static void InitClassicFilesRa(MixfileManager mfm, List<string> loadErrors, List<string> fileLoadErrors, bool forRemaster)
|
||||
{
|
||||
// Red Alert
|
||||
// Aftermath expand file. Required. Contains latest strings file.
|
||||
// Aftermath expand file. Contains latest strings file and the expansion vehicle graphics.
|
||||
mfm.LoadArchive(GameType.RedAlert, "expand2.mix", false, false, false, true);
|
||||
// Counterstrike expand file. All graphics from expand are also in expand2.mix,
|
||||
// but it could be used in modding to override different files. Not considered vital.
|
||||
@ -373,7 +373,7 @@ namespace MobiusEditor.Utility
|
||||
mfm.LoadArchive(GameType.RedAlert, "main.mix", false, true, false, true);
|
||||
// Needed for theater palettes and the remap settings in palette.cps
|
||||
mfm.LoadArchive(GameType.RedAlert, "local.mix", false, false, true, true);
|
||||
// Mod addons
|
||||
// Mod addons. Loaded with a special function.
|
||||
mfm.LoadArchives(GameType.RedAlert, "sc*.mix", true);
|
||||
// Not normally needed, but in the beta this contains palette.cps.
|
||||
mfm.LoadArchive(GameType.RedAlert, "general.mix", false, false, true, true);
|
||||
@ -392,28 +392,69 @@ namespace MobiusEditor.Utility
|
||||
mfm.Reset(GameType.RedAlert, null);
|
||||
List<string> loadedFiles = mfm.ToList();
|
||||
const string prefix = "RA: ";
|
||||
if (!loadedFiles.Contains("expand2.mix")) loadErrors.Add(prefix + "expand2.mix");
|
||||
if (!loadedFiles.Contains("local.mix")) loadErrors.Add(prefix + "local.mix");
|
||||
// Allow loading without expansion files.
|
||||
//TestMixExists(loadedFiles, loadErrors, prefix, "expand2.mix");
|
||||
TestMixExists(loadedFiles, loadErrors, prefix, "local.mix");
|
||||
if (!forRemaster)
|
||||
{
|
||||
if (!loadedFiles.Contains("conquer.mix")) loadErrors.Add(prefix + "conquer.mix");
|
||||
if (!loadedFiles.Contains("lores.mix")) loadErrors.Add(prefix + "lores.mix");
|
||||
if (!loadedFiles.Contains("lores1.mix")) loadErrors.Add(prefix + "lores1.mix");
|
||||
TestMixExists(loadedFiles, loadErrors, prefix, "conquer.mix");
|
||||
TestMixExists(loadedFiles, loadErrors, prefix, "lores.mix");
|
||||
// Allow loading without expansion files.
|
||||
//TestMixExists(loadedFiles, loadErrors, prefix, "lores1.mix");
|
||||
}
|
||||
if (!loadedFiles.Contains("temperat.mix")) loadErrors.Add(prefix + "temperat.mix");
|
||||
if (!loadedFiles.Contains("snow.mix")) loadErrors.Add(prefix + "snow.mix");
|
||||
if (!loadedFiles.Contains("interior.mix")) loadErrors.Add(prefix + "interior.mix");
|
||||
TestMixExists(loadedFiles, loadErrors, prefix, "temperat.mix");
|
||||
TestMixExists(loadedFiles, loadErrors, prefix, "snow.mix");
|
||||
TestMixExists(loadedFiles, loadErrors, prefix, "interior.mix");
|
||||
if (!forRemaster)
|
||||
{
|
||||
if (!mfm.FileExists("palette.cps")) fileLoadErrors.Add(prefix + "palette.cps");
|
||||
if (!mfm.FileExists("conquer.eng")) fileLoadErrors.Add(prefix + "conquer.eng");
|
||||
TestFileExists(mfm, loadErrors,prefix, "palette.cps");
|
||||
TestFileExists(mfm, loadErrors, prefix, "conquer.eng");
|
||||
}
|
||||
if (!mfm.FileExists("rules.ini")) fileLoadErrors.Add(prefix + "rules.ini");
|
||||
if (!mfm.FileExists("aftrmath.ini")) fileLoadErrors.Add(prefix + "aftrmath.ini");
|
||||
if (!mfm.FileExists("mplayer.ini")) fileLoadErrors.Add(prefix + "mplayer.ini");
|
||||
TestFileExists(mfm, loadErrors, prefix, "rules.ini");
|
||||
// Allow loading without expansion files.
|
||||
//TestFileExists(mfm, loadErrors,prefix, "aftrmath.ini");
|
||||
//TestFileExists(mfm, loadErrors,prefix, "mplayer.ini");
|
||||
mfm.Reset(GameType.None, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests if a mix file, or allowed equivalents of the mix file, exist.
|
||||
/// </summary>
|
||||
/// <param name="loadedFiles">The list of mix files loaded by the mixfile manager</param>
|
||||
/// <param name="errors">Current list of errors to potentially add more to.</param>
|
||||
/// <param name="prefix">Prefix string to put before the filename on the newly added error line.</param>
|
||||
/// <param name="fileNames">One or more mix files to check. If multiple are given they are seen as interchangeable; if one exists in <paramref name="loadedFiles"/>, the check passes.</param>
|
||||
private static void TestMixExists(List<string> loadedFiles, List<string> errors, string prefix, params string[] fileNames)
|
||||
{
|
||||
bool anyExist = false;
|
||||
foreach (string fileName in fileNames)
|
||||
{
|
||||
if (loadedFiles.Contains(fileName))
|
||||
{
|
||||
anyExist = true;
|
||||
}
|
||||
}
|
||||
if (!anyExist)
|
||||
{
|
||||
errors.Add(prefix + String.Join(" / ", fileNames));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests if a file can be found in the currently loaded mix archives.
|
||||
/// </summary>
|
||||
/// <param name="mixFileManager">Mix file manager</param>
|
||||
/// <param name="errors">Current list of errors to potentially add more to.</param>
|
||||
/// <param name="prefix">Prefix string to put before the filename on the newly added error line.</param>
|
||||
/// <param name="fileName">file name to check.</param>
|
||||
private static void TestFileExists(MixfileManager mixFileManager, List<string> errors, string prefix, string fileName)
|
||||
{
|
||||
if (!mixFileManager.FileExists(fileName))
|
||||
{
|
||||
errors.Add(prefix + fileName);
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddMissingRemasterText(IGameTextManager gtm)
|
||||
{
|
||||
// == Buildings ==
|
||||
|
@ -303,16 +303,15 @@ namespace MobiusEditor.Utility
|
||||
newBm.SetResolution(96, 96);
|
||||
ColorMatrix colorMatrix = new ColorMatrix();
|
||||
colorMatrix.Matrix33 = 0.5f;
|
||||
var imageAttributes = new ImageAttributes();
|
||||
imageAttributes.SetColorMatrix(
|
||||
colorMatrix,
|
||||
ColorMatrixFlag.Default,
|
||||
ColorAdjustType.Bitmap);
|
||||
using (Graphics g = Graphics.FromImage(newBm))
|
||||
using (ImageAttributes imageAttributes = new ImageAttributes())
|
||||
{
|
||||
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
|
||||
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
|
||||
g.DrawImage(bm, r, 0, 0, bm.Width, bm.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
imageAttributes.SetColorMatrix(colorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
|
||||
using (Graphics g = Graphics.FromImage(newBm))
|
||||
{
|
||||
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
|
||||
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
|
||||
g.DrawImage(bm, r, 0, 0, bm.Width, bm.Height, GraphicsUnit.Pixel, imageAttributes);
|
||||
}
|
||||
}
|
||||
Bitmap oldBm = bm;
|
||||
bm = newBm;
|
||||
|
Loading…
x
Reference in New Issue
Block a user