Skip to content

Commit

Permalink
Simplifying a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcsnider committed Aug 30, 2018
1 parent 755ffc3 commit e3c80e6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
20 changes: 9 additions & 11 deletions Intersect Character Generator/Layer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class Layer
public Dictionary<string, string> MaleParts = new Dictionary<string, string>();
public Dictionary<string, string> FemaleParts = new Dictionary<string, string>();

private List<string> directories = new List<string>();
private string directory;
private DarkComboBox cmbItems;
private DarkButton colorBtn;
private frmGenerator frmGenerator;
Expand All @@ -30,15 +30,15 @@ public class Layer
private Bitmap alteredGraphic;
public string graphicPath = "";

public Layer(string[] folderNames, DarkComboBox itemList, DarkButton colorButton, ColorDialog colorD, TrackBar intBar, TrackBar aBar,PictureBox lockPic, frmGenerator form)
public Layer(string folderName, DarkComboBox itemList, DarkButton colorButton, ColorDialog colorD, TrackBar intBar, TrackBar aBar,PictureBox lockPic, frmGenerator form)
{
if (!Directory.Exists("assets")) Directory.CreateDirectory("assets");
frmGenerator = form;
colorDialog = colorD;
intensityBar = intBar;
lockBox = lockPic;
alphaBar = aBar;
directories.AddRange(folderNames);
directory = folderName;
cmbItems = itemList;
colorBtn = colorButton;
LoadItems();
Expand Down Expand Up @@ -296,14 +296,12 @@ private void LoadItems()
{
MaleParts.Clear();
FemaleParts.Clear();
foreach (var folder in directories)
{
if (!Directory.Exists(Path.Combine("assets", folder))) Directory.CreateDirectory(Path.Combine("assets", folder));
AddImagesToList(Path.Combine("assets", folder, "male"), MaleParts);
AddImagesToList(Path.Combine("assets", folder, "female"), FemaleParts);
AddImagesToList(Path.Combine("assets", folder, "unisex"), MaleParts);
AddImagesToList(Path.Combine("assets", folder, "unisex"), FemaleParts);
}
var folder = directory;
if (!Directory.Exists(Path.Combine("assets", folder))) Directory.CreateDirectory(Path.Combine("assets", folder));
AddImagesToList(Path.Combine("assets", folder, "male"), MaleParts);
AddImagesToList(Path.Combine("assets", folder, "female"), FemaleParts);
AddImagesToList(Path.Combine("assets", folder, "unisex"), MaleParts);
AddImagesToList(Path.Combine("assets", folder, "unisex"), FemaleParts);
MaleParts = SortDictionary(MaleParts);
FemaleParts = SortDictionary(FemaleParts);
}
Expand Down
30 changes: 15 additions & 15 deletions Intersect Character Generator/frmGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ public frmGenerator()

private void frmGenerator_Load(object sender, EventArgs e)
{
_layers.Add(new Layer(new string[] { "charbase", "bodies" }, cmbBody, btnBodyHue, colorDialog, trkBodyHueIntensity, trkBodyAlpha, picBodyLock, this));
_layers.Add(new Layer(new string[] { "eyes" }, cmbEyes, btnEyesHue, colorDialog, trkEyesHueIntensity, trkEyesAlpha, picEyesLock, this));
_layers.Add(new Layer(new string[] { "hair" }, cmbHair, btnHairHue, colorDialog, trkHairHueIntensity, trkHairAlpha, picHairLock, this));
_layers.Add(new Layer(new string[] { "facialhair" }, cmbFacialHair, btnFacialHairHue, colorDialog, trkFacialHairHueIntensity, trkFacialHairAlpha, picFacialHairLock, this));
_layers.Add(new Layer(new string[] { "headwear" }, cmbHeadwear, btnHeadwearHue, colorDialog, trkHeadwearHueIntensity, trkHeadwearAlpha, picHeadwearLock, this));
_layers.Add(new Layer(new string[] { "shirt" }, cmbShirt, btnShirtHue, colorDialog, trkShirtHueIntensity, trkShirtAlpha, picShirtLock, this));
_layers.Add(new Layer(new string[] { "shoulders" }, cmbShoulders, btnShouldersHue, colorDialog, trkShouldersHueIntensity, trkShouldersAlpha, picShouldersLock, this));
_layers.Add(new Layer(new string[] { "gloves" }, cmbGloves, btnGlovesHue, colorDialog, trkGlovesHueIntensity, trkGlovesAlpha, picGlovesLock, this));
_layers.Add(new Layer(new string[] { "pants" }, cmbPants, btnPantsHue, colorDialog, trkPantsHueIntensity, trkPantsAlpha, picPantsLock, this));
_layers.Add(new Layer(new string[] { "waist" }, cmbWaist, btnWaistHue, colorDialog, trkWaistHueIntensity, trkWaistAlpha, picWaistLock, this));
_layers.Add(new Layer(new string[] { "boots" }, cmbBoots, btnBootsHue, colorDialog, trkBootsHueIntensity, trkBootsAlpha, picBootsLock, this));
_layers.Add(new Layer(new string[] { "accessories" }, cmbAccessory1, btnBootsHue, colorDialog, trkAccessory1HueIntensity, trkAccessory1Alpha, picAccessory1Lock, this));
_layers.Add(new Layer(new string[] { "accessories" }, cmbAccessory2, btnBootsHue, colorDialog, trkAccessory2HueIntensity, trkAccessory2Alpha, picAccessory2Lock, this));
_layers.Add(new Layer(new string[] { "accessories" }, cmbAccessory3, btnBootsHue, colorDialog, trkAccessory3HueIntensity, trkAccessory3Alpha, picAccessory3Lock, this));
_layers.Add(new Layer(new string[] { "accessories" }, cmbAccessory4, btnBootsHue, colorDialog, trkAccessory4HueIntensity, trkAccessory4Alpha, picAccessory4Lock, this));
_layers.Add(new Layer("bodies", cmbBody, btnBodyHue, colorDialog, trkBodyHueIntensity, trkBodyAlpha, picBodyLock, this));
_layers.Add(new Layer("eyes", cmbEyes, btnEyesHue, colorDialog, trkEyesHueIntensity, trkEyesAlpha, picEyesLock, this));
_layers.Add(new Layer("hair", cmbHair, btnHairHue, colorDialog, trkHairHueIntensity, trkHairAlpha, picHairLock, this));
_layers.Add(new Layer("facialhair", cmbFacialHair, btnFacialHairHue, colorDialog, trkFacialHairHueIntensity, trkFacialHairAlpha, picFacialHairLock, this));
_layers.Add(new Layer("headwear", cmbHeadwear, btnHeadwearHue, colorDialog, trkHeadwearHueIntensity, trkHeadwearAlpha, picHeadwearLock, this));
_layers.Add(new Layer("shirt", cmbShirt, btnShirtHue, colorDialog, trkShirtHueIntensity, trkShirtAlpha, picShirtLock, this));
_layers.Add(new Layer("shoulders", cmbShoulders, btnShouldersHue, colorDialog, trkShouldersHueIntensity, trkShouldersAlpha, picShouldersLock, this));
_layers.Add(new Layer("gloves", cmbGloves, btnGlovesHue, colorDialog, trkGlovesHueIntensity, trkGlovesAlpha, picGlovesLock, this));
_layers.Add(new Layer("pants", cmbPants, btnPantsHue, colorDialog, trkPantsHueIntensity, trkPantsAlpha, picPantsLock, this));
_layers.Add(new Layer("waist", cmbWaist, btnWaistHue, colorDialog, trkWaistHueIntensity, trkWaistAlpha, picWaistLock, this));
_layers.Add(new Layer("boots", cmbBoots, btnBootsHue, colorDialog, trkBootsHueIntensity, trkBootsAlpha, picBootsLock, this));
_layers.Add(new Layer("accessories", cmbAccessory1, btnBootsHue, colorDialog, trkAccessory1HueIntensity, trkAccessory1Alpha, picAccessory1Lock, this));
_layers.Add(new Layer("accessories", cmbAccessory2, btnBootsHue, colorDialog, trkAccessory2HueIntensity, trkAccessory2Alpha, picAccessory2Lock, this));
_layers.Add(new Layer("accessories", cmbAccessory3, btnBootsHue, colorDialog, trkAccessory3HueIntensity, trkAccessory3Alpha, picAccessory3Lock, this));
_layers.Add(new Layer("accessories", cmbAccessory4, btnBootsHue, colorDialog, trkAccessory4HueIntensity, trkAccessory4Alpha, picAccessory4Lock, this));

_saveSpriteDialog = new SaveFileDialog();
_saveSpriteDialog.Filter = "PNG Image|*.png";
Expand Down

0 comments on commit e3c80e6

Please sign in to comment.