Skip to content

Commit

Permalink
tssm layer types
Browse files Browse the repository at this point in the history
  • Loading branch information
igorseabra4 committed Apr 3, 2019
1 parent 6ca551e commit c47de50
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 23 deletions.
6 changes: 6 additions & 0 deletions IndustrialPark/ArchiveEditor/ArchiveEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1020,5 +1020,11 @@ private void listViewAssets_SizeChanged(object sender, EventArgs e)
{
columnHeader1.Width = listViewAssets.Width - 28;
}

public void SetAllTopMost(bool value)
{
TopMost = value;
archive.SetAllTopMost(value);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ private void OpenInternalEditor(Asset asset)
internalEditors.Last().Show();
}

public void SetAllTopMost(bool value)
{
foreach (var ie in internalEditors)
ie.TopMost = value;
}

public static Vector3 GetRayInterserctionPosition(Ray ray)
{
List<IRenderableAsset> l = new List<IRenderableAsset>();
Expand Down
1 change: 1 addition & 0 deletions IndustrialPark/ArchiveEditor/Other/InternalEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
public interface IInternalEditor
{
bool TopMost { get; set; }
uint GetAssetID();
void Close();
void Show();
Expand Down
17 changes: 9 additions & 8 deletions IndustrialPark/MainForm/MainForm.Designer.cs

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

66 changes: 52 additions & 14 deletions IndustrialPark/MainForm/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ public MainForm()
StartPosition = FormStartPosition.CenterScreen;

InitializeComponent();
#if !DEBUG

#if !DEBUG
addTXDArchiveToolStripMenuItem.Visible = false;
#endif
#endif

uIToolStripMenuItem_Click(null, null);
uIFTToolStripMenuItem_Click(null, null);
Expand All @@ -37,7 +37,7 @@ public MainForm()
private void MainForm_Load(object sender, EventArgs e)
{
UpdateUserTemplateComboBox();

if (File.Exists(pathToSettings))
{
IPSettings settings = JsonConvert.DeserializeObject<IPSettings>(File.ReadAllText(pathToSettings));
Expand Down Expand Up @@ -126,7 +126,7 @@ private void newToolStripMenuItem1_Click(object sender, EventArgs e)
TopMost = true;
DialogResult result = MessageBox.Show("You appear to have unsaved changes in one of your Archive Editors. Do you wish to save them before closing?", "Warning", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
TopMost = false;
if (result == DialogResult.Yes)
if (result == DialogResult.Yes)
SaveAllChanges();
else if (result == DialogResult.Cancel)
return;
Expand Down Expand Up @@ -210,7 +210,7 @@ public ProjectJson FromCurrentInstance()
}

return new ProjectJson(hips, TextureManager.OpenTextureFolders.ToList(), renderer.Camera.Position,
renderer.Camera.Yaw, renderer.Camera.Pitch, renderer.Camera.Speed, renderer.Camera.SpeedRot, renderer.Camera.FieldOfView,renderer.Camera.FarPlane,
renderer.Camera.Yaw, renderer.Camera.Pitch, renderer.Camera.Speed, renderer.Camera.SpeedRot, renderer.Camera.FieldOfView, renderer.Camera.FarPlane,
noCullingCToolStripMenuItem.Checked, wireframeFToolStripMenuItem.Checked, renderer.backgroundColor, renderer.normalColor, renderer.trigColor,
renderer.mvptColor, renderer.sfxColor, useLegacyAssetIDFormatToolStripMenuItem.Checked, alternateNamingMode, hiddenAssets, renderer.isDrawingUI,
AssetJSP.dontRender, AssetBOUL.dontRender, AssetBUTN.dontRender, AssetCAM.dontRender, AssetDSTR.dontRender, AssetDYNA.dontRender, AssetEGEN.dontRender,
Expand Down Expand Up @@ -444,7 +444,7 @@ private void ResetMouseCenter(object sender, EventArgs e)
{
MouseCenter = renderPanel.PointToScreen(new System.Drawing.Point(renderPanel.Width / 2, renderPanel.Height / 2));
}

private HashSet<Keys> PressedKeys = new HashSet<Keys>();

private void MainForm_KeyDown(object sender, KeyEventArgs e)
Expand Down Expand Up @@ -702,7 +702,7 @@ private void renderPanel_MouseDown(object sender, MouseEventArgs e)
renderPanel.ClientRectangle.Height), e.X, e.Y, true);
}
}

public void ScreenClicked(Rectangle viewRectangle, int X, int Y, bool isMouseDown = false)
{
if (ArchiveEditorFunctions.FinishedMovingGizmo)
Expand Down Expand Up @@ -771,7 +771,7 @@ private void addTextureFolderToolStripMenuItem_Click(object sender, EventArgs e)

private void addTXDArchiveToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog openFile = new OpenFileDialog() { Filter = "TXD files|*.txd"};
OpenFileDialog openFile = new OpenFileDialog() { Filter = "TXD files|*.txd" };
if (openFile.ShowDialog() == DialogResult.OK)
TextureManager.LoadTexturesFromTXD(openFile.FileName);
}
Expand All @@ -786,7 +786,7 @@ private void levelModelToolStripMenuItem_Click(object sender, EventArgs e)
levelModelToolStripMenuItem.Checked = !levelModelToolStripMenuItem.Checked;
AssetJSP.dontRender = !levelModelToolStripMenuItem.Checked;
}

private void bUTNToolStripMenuItem_Click(object sender, EventArgs e)
{
bUTNToolStripMenuItem.Checked = !bUTNToolStripMenuItem.Checked;
Expand Down Expand Up @@ -977,7 +977,7 @@ public void ClearTemplateFocus()
foreach (ArchiveEditor archiveEditor in archiveEditors)
archiveEditor.TemplateFocusOff();
}

private void useLegacyAssetIDFormatToolStripMenuItem_Click(object sender, EventArgs e)
{
useLegacyAssetIDFormatToolStripMenuItem.Checked = !useLegacyAssetIDFormatToolStripMenuItem.Checked;
Expand Down Expand Up @@ -1027,7 +1027,7 @@ public static void PopulateTemplateMenusAt(ToolStripMenuItem menu, EventHandler
foreach (ToolStripItem i in controllers.DropDownItems)
if (i is ToolStripMenuItem j)
j.Click += eventHandler;

ToolStripMenuItem pickups = new ToolStripMenuItem("Pickups and Tikis");
pickups.DropDownItems.AddRange(new ToolStripItem[]
{
Expand Down Expand Up @@ -1178,7 +1178,7 @@ private void TemplateToolStripItemClick(object sender, EventArgs e)
MessageBox.Show("There was a problem setting your template for placement");
TopMost = false;
}

private void userTemplateToolStripMenuItem_Click(object sender, EventArgs e)
{
UpdateUserTemplateComboBox();
Expand Down Expand Up @@ -1264,5 +1264,43 @@ private void assetIDGeneratorToolStripMenuItem_Click(object sender, EventArgs e)
{
Program.AssetIDGenerator.Show();
}

private void MainForm_Resize(object sender, EventArgs e)
{
try
{
if (WindowState == FormWindowState.Minimized)
{
ArchiveEditorFunctions.allowRender = false;
SetAllTopMost(false);
}
else
{
ArchiveEditorFunctions.allowRender = true;
SetAllTopMost(true);
}
}
catch
{
}
}

private bool allTopMost = true;

private void SetAllTopMost(bool value)
{
Program.AboutBox.TopMost = value;
Program.ViewConfig.TopMost = value;
Program.UserTemplateManager.TopMost = value;

Program.EventSearch.TopMost = value;
Program.PlatSearch.TopMost = value;
Program.AssetIDGenerator.TopMost = value;

foreach (ArchiveEditor ae in archiveEditors)
ae.SetAllTopMost(value);

allTopMost = value;
}
}
}
}

0 comments on commit c47de50

Please sign in to comment.