private void NUD_ValueChanged(object sender, EventArgs e) { if (!(sender is NumericUpDown)) { return; } NumericUpDown nud = (NumericUpDown)(sender); uint id = InputFormRef.GetStructID("", nud.Name); Control c = InputFormRef.FindObjectByForm <LabelEx>(InputFormRef.Controls, "J_" + id); if (!(c is LabelEx)) { return; } LabelEx label = (LabelEx)c; if (FilterComboBox.SelectedIndex <= 2) { uint value = (uint)nud.Value; if (value <= 255 || value <= 15) { label.ErrorMessage = ""; } else { label.ErrorMessage = R._("タイルの移動コストが正しくありません。\r\n移動できないタイルは255に、移動できるタイルは0-15の範囲に設定しないといけません。"); } } else { label.ErrorMessage = ""; } }
static List <NameMapping> MakeStruct(InputFormRef ifr, List <Control> controls) { List <String> unionPrefList = ifr.UnionPrefixList; List <NameMapping> dic = new List <NameMapping>(); foreach (Control info in controls) { if (!(info is NumericUpDown)) { continue; } string prefix = ifr.Prefix; NumericUpDown info_object = ((NumericUpDown)info); String name = InputFormRef.SkipPrefixName(info.Name, prefix); if (name.Length <= 0) { continue; } if (!InputFormRef.IsTypeWord(name[0])) { if (ifr.UnionTab != null) { prefix = InputFormRef.ConvertUniTabPageToSelectedUnionPrefixName(ifr.UnionTab); name = InputFormRef.SkipPrefixName(info.Name, prefix); if (name.Length <= 0) { continue; } } if (!InputFormRef.IsTypeWord(name[0])) { continue; } } NameMapping nm = new NameMapping(); nm.TypeName = name; nm.Id = U.atoi(name.Substring(1)); nm.Value = info_object; uint id = U.atoi(name.Substring(1)); string labelname = prefix + "L_" + id + "_"; nm.Label = InputFormRef.FindObjectByFormFirstMatch <Control>(controls, labelname); string jumpname = prefix + "J_" + id + "_"; nm.Jump = InputFormRef.FindObjectByFormFirstMatch <Control>(controls, jumpname); if (nm.Jump == null) { jumpname = prefix + "J_" + id; nm.Jump = InputFormRef.FindObjectByForm <Control>(controls, jumpname); } dic.Add(nm); } if (dic.Count <= 0) { MakeStructDWORD(ifr, dic); } dic.Sort(); return(dic); }