Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrated the Environment Lighting Editor #9

Merged
merged 10 commits into from
Jan 12, 2014
Prev Previous commit
Next Next commit
Exposed some variables from MainForm to be public (namely the room an…
…d stage list) until that is re-written to be less... crappy.

Added a dropdown to choose which stage.dzs the Environment Editor is looking in for chunks.
  • Loading branch information
LordNed committed Jan 12, 2014
commit fc544beed000d27f3c6f0d6709aff2568c238d9d
26 changes: 19 additions & 7 deletions WWActorEdit/Forms/EnvironmentLightingEditorForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 25 additions & 1 deletion WWActorEdit/Forms/EnvironmentLightingEditorForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,41 @@
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WWActorEdit.Kazari.DZx;

namespace WWActorEdit.Forms
{
public partial class EnvironmentLightingEditorForm : Form
{
public EnvironmentLightingEditorForm()
//Set by the MainForm when it opens this Popup
private MainForm _mainForm;

public EnvironmentLightingEditorForm(MainForm parent)
{
InitializeComponent();

_mainForm = parent;
}

/// <summary>
/// Called when the Form is loaded. This is a temporary solution until there's some form of Event evoked by
/// Archives being loaded. We'll grab the loaded archives from the MainForm and populate our list of DZS files
/// with it.
/// </summary>
private void EnvironmentLightingEditorForm_Load(object sender, EventArgs e)
{
ZeldaArc stage = _mainForm.Stage;
//For each loaded Archive we're going to want to grab the DZS file out of them.
foreach (DZx dzS in stage.DZSs)
{
dzsFileDropdown.Items.Add(Path.GetFileName(stage.Filename) + @"\" + dzS.FileEntry.FileName);
}

dzsFileDropdown.SelectedIndex = 0;
}
}
}
6 changes: 3 additions & 3 deletions WWActorEdit/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ namespace WWActorEdit
public partial class MainForm : Form
{
//A list of currently loaded .arc Archives
List<ZeldaArc> Rooms = new List<ZeldaArc>();
public List<ZeldaArc> Rooms = new List<ZeldaArc>();
//Shortcut to the 'Stage' one if it is loaded.
ZeldaArc Stage;
public ZeldaArc Stage;

//idek
IDZxChunkElement SelectedDZRChunkElement;
Expand Down Expand Up @@ -514,7 +514,7 @@ private void showReadmeToolStripMenuItem_Click(object sender, EventArgs e)

private void environmentLightingEditorToolStripMenuItem_Click(object sender, EventArgs e)
{
EnvironmentLightingEditorForm popup = new EnvironmentLightingEditorForm();
EnvironmentLightingEditorForm popup = new EnvironmentLightingEditorForm(this);
popup.Show(this);
}
}
Expand Down
9 changes: 9 additions & 0 deletions WWActorEdit/Source/DZS/FileFormat.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
using System;
using System.Collections.Generic;

namespace WWActorEdit
{
public class DZSFormat
{
public DZSHeader Header;
public List<DZSChunk> Chunks;
}



public struct DZSHeader
{
public UInt32 ChunkCount;
Expand Down