예제 #1
0
 internal LayerPropertiesForm(Mainframe parent, Layer layer, bool showLayerSelection)
 {
     SourceForm         = parent;
     DataSource         = layer;
     CurrentLayer       = (byte)((showLayerSelection) ? parent.J2L.AllLayers.IndexOf(layer) : 0);
     ShowLayerSelection = showLayerSelection;
     InitializeComponent();
 }
예제 #2
0
파일: LayerOrderForm.cs 프로젝트: jgke/MLLE
        internal bool ShowForm(Mainframe source, List <Layer> layers)
        {
            SourceForm = source;
            SourceList = layers;
            listBox1.Items.AddRange(SourceList.ToArray());

            ShowDialog();

            return(ChangesMade || ExistingLayerEdited);
        }
예제 #3
0
파일: EventForm.cs 프로젝트: jgke/MLLE
        public EventForm(Mainframe parent, TreeNode[] nodes, Version theVersion, AGAEvent inputevent, string[][] eventStrings)
        {
            WorkingEvent = inputevent;
            SourceForm   = parent;
            parent.SelectReturnAGAEvent = null;
            version = theVersion;
            LevelSpecificEventStringList = eventStrings;
            InitializeComponent();
            int arrayLength = (version == Version.AGA) ? 24 : 6;

            ParamBoxes = new NumericUpDown[arrayLength]; ParamBoxes[0] = numericUpDown1;
            ParamSoundPlayerButtons = new Button[arrayLength]; ParamSoundPlayerButtons[0] = button1; button1.Tag = numericUpDown1;
            ParamLabels             = new Label[arrayLength]; ParamLabels[0] = label1;
            ParamCheckboxes         = new CheckBox[arrayLength]; ParamCheckboxes[0] = checkBox1;
            ParamDropdowns          = new ComboBox[arrayLength]; ParamDropdowns[0] = comboBox1;
            if (version == Version.AGA)
            {
                BitBoxes       = new CheckBox[] { BitBox1, BitBox2, BitBox3, BitBox4, BitBox5, BitBox6, BitBox7, BitBox8, BitBox9, BitBox10 };
                ParamTextboxes = new TextBox[24]; ParamTextboxes[0] = textBox1;
            }
            else
            {
                textBox1.Dispose();
            }
            CombosPointingToCombos = new Dictionary <ComboBox, List <ComboBox> > {
                { comboBox1, new List <ComboBox>() }
            };
            Tree.Nodes.Add("0", "(none)"); //always present
            Tree.Nodes.AddRange(nodes);
            Tree.Sort();
            if (version != Version.AGA)
            {
                Tree.Sorted = false; //add new things freely in arbitary orders
                if (LastUsedEvents.Count > 0)
                {
                    var recentNodes = new TreeNode("[Recent]");
                    foreach (UInt32 lastEvent in LastUsedEvents)
                    {
                        var node = new TreeNode(SourceForm.NameEvent(lastEvent, "(unknown)"));
                        node.Tag = lastEvent;
                        recentNodes.Nodes.Add(node);
                    }
                    Tree.Nodes.Add(recentNodes);
                }
            }
            ListBox.Size  = Tree.Size;
            FlatEventList = SourceForm.FlatEventLists[SourceForm.J2L.VersionType];
        }
예제 #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            listBox1.Items.Clear();

            var findParameterName          = comboBox1.Text.Trim();
            var parameterLocationsPerEvent = new int[256];
            var foundValues = new SortedSet <int>();

            if (findParameterName.Length > 0)
            {
                for (int eventID = 1; eventID < 256; ++eventID)
                {
                    var ev = EventStrings[eventID];
                    for (int i = 5; i < ev.Length; ++i)
                    {
                        if (String.Equals(ev[i].Split(':')[0].Trim(), findParameterName, StringComparison.OrdinalIgnoreCase))
                        {
                            parameterLocationsPerEvent[eventID] = i - 4;
                            break;
                        }
                    }
                }
            }

            foreach (var eventBits in EventMap)
            {
                var eventID = eventBits & 0xFF;
                if (parameterLocationsPerEvent[eventID] != 0)
                {
                    foundValues.Add(Mainframe.ExtractParameterValues(eventBits, EventStrings[eventID])[parameterLocationsPerEvent[eventID] - 1]);
                }
            }

            listBox1.Items.AddRange(foundValues.Select(val => val.ToString()).ToArray());
            if (listBox1.Items.Count == 0)
            {
                ResultPrintout.Text = "(found no matches)";
            }
            else
            {
                int i;
                for (i = 0; foundValues.Contains(i); ++i)
                {
                    ;
                }
                ResultPrintout.Text = "First free value: " + i.ToString();
            }
        }
예제 #5
0
파일: EventForm.cs 프로젝트: jgke/MLLE
 private void CheckEverythingForThisNewEvent()
 {
     ModeSelect.SelectedIndex = (int)J2LFile.GetRawBits(WorkingEvent.ID, 8, 2);
     Illuminate.Checked       = (WorkingEvent.ID & 1024) == 1024;
     int[] parmvalues = Mainframe.ExtractParameterValues(WorkingEvent.ID, CurrentEvent);
     for (byte i = 0; i < 6; i++)
     {
         LastParameterValues[i] = parmvalues[i];
     }
     if (CurrentEventID == SourceForm.GeneratorEventID)
     {
         SetupEvent(); Generator.Checked = true; Findit((byte)parmvalues[0]);
     }
     else
     {
         Findit(CurrentEventID);
     }
 }
예제 #6
0
 public LevelProperties(Mainframe parent)
 {
     SourceForm = parent;
     InitializeComponent();
 }