public Map16Editor() { InitializeComponent(); CmbGraphics1.DisplayMember = CmbGraphics2.DisplayMember = CmbPalettes.DisplayMember = CmbDefinitions.DisplayMember = "Name"; foreach (var g in ProjectController.GraphicsManager.GraphicsInfo) { CmbGraphics1.Items.Add(g); CmbGraphics2.Items.Add(g); } foreach (var p in ProjectController.PaletteManager.Palettes) { CmbPalettes.Items.Add(p); } foreach (var l in ProjectController.LevelManager.LevelTypes) { CmbDefinitions.Items.Add(l); } CurrentTable = ProjectController.GraphicsManager.BuildPatternTable(0); PtvTable.CurrentTable = CurrentTable; BlsBlocks.CurrentTable = CurrentTable; BlsBlocks.BlockLayout = ProjectController.LayoutManager.BlockLayouts[0]; BlvCurrent.CurrentTable = CurrentTable; BlsBlocks.SpecialTable = ProjectController.SpecialManager.SpecialTable; BlsBlocks.SpecialPalette = ProjectController.SpecialManager.SpecialPalette; CmbGraphics1.SelectedIndex = 8; CmbGraphics2.SelectedIndex = 0x64; CmbPalettes.SelectedIndex = 0; CmbDefinitions.SelectedIndex = 0; BlsBlocks.SelectionChanged += new EventHandler <TEventArgs <MouseButtons> >(BlsBlocks_SelectionChanged); BlsBlocks.SelectedIndex = 0; solidityMap[0] = BlockProperty.Background; solidityMap[1] = BlockProperty.Foreground; solidityMap[2] = BlockProperty.Water; solidityMap[3] = BlockProperty.Water | BlockProperty.Foreground; solidityMap[4] = BlockProperty.SolidTop; solidityMap[5] = BlockProperty.SolidBottom; solidityMap[6] = BlockProperty.SolidAll; solidityMap[7] = BlockProperty.CoinBlock; for (int i = 0; i < 16; i++) { SpecialTypes.Add(((BlockProperty)(0xF0 | i)).ToString()); } }
/// <summary> /// Initializes the types. /// </summary> private void InitializeTypes() { string[] scalarTypes = { "bool", "int", "half", "float", "double", "string", // Actually not a scalar type, but treated similarly. }; foreach (string type in scalarTypes) { ScalarTypes.Add(new TypeCompletionData(type)); } string[] types = { "bool1", "bool2", "bool3", "bool4", "bool1x1", "bool1x2", "bool1x3", "bool1x4", "bool2x1", "bool2x2", "bool2x3", "bool2x4", "bool3x1", "bool3x2", "bool3x3", "bool3x4", "bool4x1", "bool4x2", "bool4x3", "bool4x4", "int1", "int2", "int3", "int4", "int1x1", "int1x2", "int1x3", "int1x4", "int2x1", "int2x2", "int2x3", "int2x4", "int3x1", "int3x2", "int3x3", "int3x4", "int4x1", "int4x2", "int4x3", "int4x4", "half1", "half2", "half3", "half4", "half1x1", "half1x2", "half1x3", "half1x4", "half2x1", "half2x2", "half2x3", "half2x4", "half3x1", "half3x2", "half3x3", "half3x4", "half4x1", "half4x2", "half4x3", "half4x4", "float1", "float2", "float3", "float4", "float1x1", "float1x2", "float1x3", "float1x4", "float2x1", "float2x2", "float2x3", "float2x4", "float3x1", "float3x2", "float3x3", "float3x4", "float4x1", "float4x2", "float4x3", "float4x4", "double1", "double2", "double3", "double4", "double1x1", "double1x2", "double1x3", "double1x4", "double2x1", "double2x2", "double2x3", "double2x4", "double3x1", "double3x2", "double3x3", "double3x4", "double4x1", "double4x2", "double4x3", "double4x4", }; foreach (string type in types) { Types.Add(new TypeCompletionData(type)); } string[] specialTypes = { "void", "sampler","sampler1D", "sampler2D", "sampler3D", "samplerCUBE", "sampler_state", "struct", }; foreach (string type in specialTypes) { SpecialTypes.Add(new TypeCompletionData(type)); } string[] effectTypes = { "technique", "pass", "asm", }; foreach (string type in effectTypes) { EffectTypes.Add(new TypeCompletionData(type)); } }