public BlockDetailsForm(IEnumerable<SaveBlock> blocks, Point popupLocation, BlockViewWrapperControl Wrapper) { this.oldBlocks.AddRange(blocks.Clone()); this.blocks.AddRange(blocks); this.wrapper = Wrapper; StartPosition = FormStartPosition.Manual; Location = popupLocation; InitializeComponent(); blockTypesDropDown.Items.AddRange(Enum.GetNames(typeof(BlockType))); blockTypesDropDown.Items.Remove(Enum.GetName(typeof(BlockType), BlockType.OUT_OF_BOUNDS)); blockTypesDropDown.Items.Remove(Enum.GetName(typeof(BlockType), BlockType.EMPTY)); if (this.blocks.All(block => block.Type == this.blocks.First().Type)) { oldBlockType.Text = blockTypesDropDown.Text = System.Enum.GetName(typeof(BlockType), this.blocks.First().Type); } else { oldBlockType.Text = blockTypesDropDown.Text = MULTIPLE_ENTRY_TEXT; } if (this.blocks.All(block => string.IsNullOrWhiteSpace(block.Script))) { scriptNameBox.Text = ""; oldScriptName.Text = NO_SCRIPT_NAME_TEXT; } else if (this.blocks.All(block => block.Script == this.blocks.First().Script)) { oldScriptName.Text = scriptNameBox.Text = this.blocks.First().Script; } else { oldScriptName.Text = scriptNameBox.Text = MULTIPLE_ENTRY_TEXT; } setupDone = true; updateBlocks(); }
public override void Initialize(MainForm MainForm, BlockViewWrapperControl wrapper) { base.Initialize(MainForm, wrapper); MouseDown += new MouseEventHandler(TextureProjectionControl_MouseDown); }
public virtual void Initialize(MainForm mainForm, BlockViewWrapperControl wrapper) { this.MainForm = mainForm; this.Wrapper = wrapper; spriteBatch = new SpriteBatch(mainForm.GraphicsDevice); spriteFont = MainForm.Content.Load<SpriteFont>("hudFont"); samplerState = new SamplerState(); samplerState.Filter = TextureFilter.PointMipLinear; samplerState.AddressU = TextureAddressMode.Clamp; samplerState.AddressV = TextureAddressMode.Clamp; textureBlock = MainForm.Content.Load<Texture2D>("block31"); textureDrawing = MainForm.Content.Load<Texture2D>("block31drawing"); textureGridFilled = MainForm.Content.Load<Texture2D>("block31filledGrid"); textureGridStriped = MainForm.Content.Load<Texture2D>("block31stripedGrid"); textureWireframe = MainForm.Content.Load<Texture2D>("block31wireframe"); textureWireframeBack = MainForm.Content.Load<Texture2D>("block31wireframeBack"); textureWireframeFilled = MainForm.Content.Load<Texture2D>("block31wireframeFilled"); setupBlockDrawStateTextures(); base.MouseDown += new MouseEventHandler(BlockViewControl_MouseDown); base.MouseMove += new MouseEventHandler(BlockViewControl_MouseMove); MouseWheel += new MouseEventHandler(BlockViewControl_MouseWheel); MouseUp += new MouseEventHandler(BlockViewControl_MouseUp); }