mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-22 20:02:48 +00:00
"Reset" button was missing from "Draw Grid" settings.
Buttons order was messed up in editing modes toolbar after performing "Reload Resources" action. Fixed editing modes toolbar layout.
This commit is contained in:
parent
2d874973bf
commit
8599f18f4c
9 changed files with 45 additions and 27 deletions
|
@ -1619,14 +1619,11 @@ namespace CodeImp.DoomBuilder {
|
|||
General.MainWindow.DisplayReady();
|
||||
|
||||
}
|
||||
internal void ReloadResources() {
|
||||
DataLocation maplocation;
|
||||
StatusInfo oldstatus;
|
||||
Cursor oldcursor;
|
||||
|
||||
internal void ReloadResources() {
|
||||
// Keep old display info
|
||||
oldstatus = General.MainWindow.Status;
|
||||
oldcursor = Cursor.Current;
|
||||
StatusInfo oldstatus = General.MainWindow.Status;
|
||||
Cursor oldcursor = Cursor.Current;
|
||||
|
||||
// Show status
|
||||
General.MainWindow.DisplayStatus(StatusType.Busy, "Reloading data resources...");
|
||||
|
@ -1650,7 +1647,7 @@ namespace CodeImp.DoomBuilder {
|
|||
General.WriteLogLine("Reloading data resources...");
|
||||
data = new DataManager();
|
||||
if (!string.IsNullOrEmpty(filepathname)) {
|
||||
maplocation = new DataLocation(DataLocation.RESOURCE_WAD, filepathname, false, false, false);
|
||||
DataLocation maplocation = new DataLocation(DataLocation.RESOURCE_WAD, filepathname, false, false, false);
|
||||
data.Load(configinfo.Resources, options.Resources, maplocation);
|
||||
}
|
||||
else {
|
||||
|
|
5
Source/Core/Windows/MainForm.Designer.cs
generated
5
Source/Core/Windows/MainForm.Designer.cs
generated
|
@ -1,3 +1,4 @@
|
|||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Controls;
|
||||
|
||||
namespace CodeImp.DoomBuilder.Windows
|
||||
|
@ -2383,7 +2384,9 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.modestoolbar.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.modestoolbar.Location = new System.Drawing.Point(0, 49);
|
||||
this.modestoolbar.Name = "modestoolbar";
|
||||
this.modestoolbar.Size = new System.Drawing.Size(32, 515);
|
||||
this.modestoolbar.Size = new System.Drawing.Size(30, 515);
|
||||
this.modestoolbar.Padding = new Padding(2, 0, 2, 0);
|
||||
this.modestoolbar.AutoSize = false;
|
||||
this.modestoolbar.TabIndex = 8;
|
||||
this.modestoolbar.Text = "toolStrip1";
|
||||
this.modestoolbar.Visible = false;
|
||||
|
|
|
@ -1664,6 +1664,10 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
|
||||
//mxd
|
||||
public void AddModesButton(ToolStripItem button, string group) {
|
||||
// Set proper styling
|
||||
button.Padding = new Padding(0, 1, 0, 1);
|
||||
button.Margin = new Padding();
|
||||
|
||||
// Fix tags to full action names
|
||||
ToolStripItemCollection items = new ToolStripItemCollection(toolbar, new ToolStripItem[0]);
|
||||
items.Add(button);
|
||||
|
@ -1878,12 +1882,12 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
foreach(ToolStripItem i in editmodeitems)
|
||||
{
|
||||
// Remove it and restart
|
||||
modestoolbar.Items.Remove(i); //mxd
|
||||
menumode.DropDownItems.Remove(i);
|
||||
i.Dispose();
|
||||
}
|
||||
|
||||
// Done
|
||||
modestoolbar.Items.Clear(); //mxd
|
||||
editmodeitems.Clear();
|
||||
UpdateSeparators();
|
||||
}
|
||||
|
@ -1894,7 +1898,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// Create a button
|
||||
ToolStripSeparator item = new ToolStripSeparator();
|
||||
item.Text = group; //mxd
|
||||
item.Margin = new Padding(6, 0, 6, 0);
|
||||
item.Margin = new Padding(0, 3, 0, 3); //mxd
|
||||
modestoolbar.Items.Add(item); //mxd
|
||||
editmodeitems.Add(item);
|
||||
|
||||
|
@ -1917,6 +1921,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// Create a button
|
||||
ToolStripItem item = new ToolStripButton(modeinfo.ButtonDesc, modeinfo.ButtonImage, EditModeButtonHandler);
|
||||
item.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
||||
item.Padding = new Padding(0, 2, 0, 2);
|
||||
item.Margin = new Padding();
|
||||
item.Tag = modeinfo;
|
||||
modestoolbar.Items.Add(item); //mxd
|
||||
editmodeitems.Add(item);
|
||||
|
@ -1997,11 +2003,11 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
}
|
||||
|
||||
private void toolbarContextMenu_KeyDown(object sender, KeyEventArgs e) {
|
||||
toolbarContextMenuShiftPressed = e.KeyCode == Keys.ShiftKey;
|
||||
toolbarContextMenuShiftPressed = (e.KeyCode == Keys.ShiftKey);
|
||||
}
|
||||
|
||||
private void toolbarContextMenu_KeyUp(object sender, KeyEventArgs e) {
|
||||
toolbarContextMenuShiftPressed = !(e.KeyCode == Keys.ShiftKey);
|
||||
toolbarContextMenuShiftPressed = (e.KeyCode != Keys.ShiftKey);
|
||||
}
|
||||
|
||||
private void toggleFile_Click(object sender, EventArgs e) {
|
||||
|
|
|
@ -63,6 +63,11 @@ namespace CodeImp.DoomBuilder.BuilderEffects
|
|||
menusForm.Unregister();
|
||||
}
|
||||
|
||||
public override void OnReloadResources() {
|
||||
base.OnReloadResources();
|
||||
menusForm.Register();
|
||||
}
|
||||
|
||||
//actions
|
||||
[BeginAction("applyjitter")]
|
||||
private void applyJitterTransform() {
|
||||
|
|
|
@ -25,8 +25,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
public void Unregister() {
|
||||
General.Interface.RemoveButton(seglabel);
|
||||
General.Interface.RemoveButton(seglen);
|
||||
General.Interface.RemoveButton(seglabel);
|
||||
}
|
||||
|
||||
private void seglen_ValueChanged(object sender, EventArgs e) {
|
||||
|
|
|
@ -36,11 +36,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
public void Unregister() {
|
||||
General.Interface.RemoveButton(subdivslabel);
|
||||
General.Interface.RemoveButton(subdivs);
|
||||
General.Interface.RemoveButton(spikinesslabel);
|
||||
General.Interface.RemoveButton(spikiness);
|
||||
General.Interface.RemoveButton(reset);
|
||||
General.Interface.RemoveButton(spikiness);
|
||||
General.Interface.RemoveButton(spikinesslabel);
|
||||
General.Interface.RemoveButton(subdivs);
|
||||
General.Interface.RemoveButton(subdivslabel);
|
||||
}
|
||||
|
||||
private void ValueChanged(object sender, EventArgs e) {
|
||||
|
|
|
@ -25,19 +25,21 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
General.Interface.AddButton(slicesH);
|
||||
General.Interface.AddButton(slicesvlabel);
|
||||
General.Interface.AddButton(slicesV);
|
||||
General.Interface.AddButton(reset);
|
||||
General.Interface.AddButton(cbseparator);
|
||||
General.Interface.AddButton(gridlock);
|
||||
General.Interface.AddButton(triangulate);
|
||||
}
|
||||
|
||||
public void Unregister() {
|
||||
General.Interface.RemoveButton(sliceshlabel);
|
||||
General.Interface.RemoveButton(slicesH);
|
||||
General.Interface.RemoveButton(slicesvlabel);
|
||||
General.Interface.RemoveButton(slicesV);
|
||||
General.Interface.RemoveButton(cbseparator);
|
||||
General.Interface.RemoveButton(gridlock);
|
||||
General.Interface.RemoveButton(triangulate);
|
||||
General.Interface.RemoveButton(gridlock);
|
||||
General.Interface.RemoveButton(cbseparator);
|
||||
General.Interface.RemoveButton(reset);
|
||||
General.Interface.RemoveButton(slicesV);
|
||||
General.Interface.RemoveButton(slicesvlabel);
|
||||
General.Interface.RemoveButton(slicesH);
|
||||
General.Interface.RemoveButton(sliceshlabel);
|
||||
}
|
||||
|
||||
private void ValueChanged(object sender, EventArgs e) {
|
||||
|
|
|
@ -36,11 +36,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
public void Unregister() {
|
||||
General.Interface.RemoveButton(radiuslabel);
|
||||
General.Interface.RemoveButton(radius);
|
||||
General.Interface.RemoveButton(subdivslabel);
|
||||
General.Interface.RemoveButton(subdivs);
|
||||
General.Interface.RemoveButton(reset);
|
||||
General.Interface.RemoveButton(subdivs);
|
||||
General.Interface.RemoveButton(subdivslabel);
|
||||
General.Interface.RemoveButton(radius);
|
||||
General.Interface.RemoveButton(radiuslabel);
|
||||
}
|
||||
|
||||
private void ValueChanged(object sender, EventArgs e) {
|
||||
|
|
|
@ -47,6 +47,11 @@ namespace CodeImp.DoomBuilder.ColorPicker
|
|||
toolsform.Unregister();
|
||||
}
|
||||
|
||||
public override void OnReloadResources() {
|
||||
base.OnReloadResources();
|
||||
toolsform.Register();
|
||||
}
|
||||
|
||||
public override void Dispose() {
|
||||
base.Dispose();
|
||||
General.Actions.UnbindMethods(this);
|
||||
|
|
Loading…
Reference in a new issue