mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-08 00:32:20 +00:00
Draw Curve Mode: added settings panel. Sectors mode: added "Make Door" button to the toolbar. Swapped Side panel and Info panel z-order. Interface: split toolbar into 3 separate toolbars. All toolbar buttons are now viewable at 1024x768. Interface: grouped stuff in "Modes" menu a bit better. Interface: added "Draw [stuff]" buttons to modes toolbar. Interface: reorganized main menu. Hope it makes more sense now. API: added General.Interface.AddModesButton() and General.Interface.AddModesMenu(), which can be used to add buttons to specific group in "Modes" toolbar and menu items to specific group in "Modes" menu, so actions, which behave like an editing mode, but are not part of one can be added there.
45 lines
1.8 KiB
C#
45 lines
1.8 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
using CodeImp.DoomBuilder.Actions;
|
|
|
|
namespace CodeImp.DoomBuilder.BuilderModes
|
|
{
|
|
public partial class DrawEllipseOptionsPanel : UserControl
|
|
{
|
|
public event EventHandler OnValueChanged;
|
|
private bool blockEvents;
|
|
|
|
private static int aquityValue;
|
|
private static int subdivsValue = 8;
|
|
|
|
public int Aquity { get { return (int)spikiness.Value; } set { blockEvents = true; spikiness.Value = value; blockEvents = false; } }
|
|
public int Subdivisions { get { return (int)subdivs.Value; } set { blockEvents = true; subdivs.Value = value; blockEvents = false; } }
|
|
public int MaxSubdivisions { set { subdivs.Maximum = value; } }
|
|
public int MinSubdivisions { set { subdivs.Minimum = value; } }
|
|
|
|
public DrawEllipseOptionsPanel() {
|
|
InitializeComponent();
|
|
|
|
spikiness.Value = aquityValue;
|
|
subdivs.Value = subdivsValue;
|
|
spikiness.ValueChanged += ValueChanged;
|
|
subdivs.ValueChanged += ValueChanged;
|
|
|
|
//set hints
|
|
string help = "Use <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_increasebevel") + "</b> and <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_decreasebevel") + "</b> to change ellipse spikiness<br>"
|
|
+ "Use <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_increasesubdivlevel") + "</b> and <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_decreasesubdivlevel") + "</b> to change the number of points in ellipse";
|
|
hints.SelectedRtf = HintsManager.GetRtfString(help);
|
|
}
|
|
|
|
private void ValueChanged(object sender, EventArgs e) {
|
|
aquityValue = (int)spikiness.Value;
|
|
subdivsValue = (int)subdivs.Value;
|
|
if(!blockEvents && OnValueChanged != null) OnValueChanged(this, EventArgs.Empty);
|
|
}
|
|
|
|
private void reset_Click(object sender, EventArgs e) {
|
|
spikiness.Value = 0;
|
|
subdivs.Value = subdivs.Minimum;
|
|
}
|
|
}
|
|
}
|