/* ZTextureEditorPanel::updateTextureControls * Updates all texture editing controls with values from the texture *******************************************************************/ void ZTextureEditorPanel::updateTextureControls() { // Check texture is open if (!tex_current) return; text_tex_name->SetValue(tex_current->getName()); spin_tex_width->SetValue(tex_current->getWidth()); spin_tex_height->SetValue(tex_current->getHeight()); spin_tex_scalex->SetValue(tex_current->getScaleX()); spin_tex_scaley->SetValue(tex_current->getScaleY()); spin_tex_offsetx->SetValue(tex_current->getOffsetX()); spin_tex_offsety->SetValue(tex_current->getOffsetY()); updateTextureScaleLabel(); // Update type if (tex_current->getType() == "Texture") choice_type->SetSelection(0); else if (tex_current->getType() == "Sprite") choice_type->SetSelection(1); else if (tex_current->getType() == "Graphic") choice_type->SetSelection(2); else if (tex_current->getType() == "WallTexture") choice_type->SetSelection(3); else if (tex_current->getType() == "Flat") choice_type->SetSelection(4); else choice_type->SetSelection(0); // Update flags cb_optional->SetValue(tex_current->isOptional()); cb_worldpanning->SetValue(tex_current->worldPanning()); cb_nodecals->SetValue(tex_current->noDecals()); cb_nulltexture->SetValue(tex_current->nullTexture()); }
/* TextureEditorPanel::onTexScaleYChanged * Called when the texture y scale spin control is changed *******************************************************************/ void TextureEditorPanel::onTexScaleYChanged(wxCommandEvent& e) { // Set texture's y scale if (tex_current) tex_current->setScaleY((double)spin_tex_scaley->GetValue() / 8.0); // Update UI updateTextureScaleLabel(); tex_modified = true; }
/* TextureEditorPanel::onTexHeightChanged * Called when the texture height spin control is changed *******************************************************************/ void TextureEditorPanel::onTexHeightChanged(wxCommandEvent& e) { // Set texture's height if (tex_current) tex_current->setHeight(spin_tex_height->GetValue()); // Update UI tex_canvas->redraw(true); updateTextureScaleLabel(); tex_modified = true; }
/* ZTextureEditorPanel::onTexScaleYChanged * Called when the texture y scale spin control is changed *******************************************************************/ void ZTextureEditorPanel::onTexScaleYChanged(wxCommandEvent& e) { // Set texture's y scale if (tex_current) tex_current->setScaleY(spin_tex_scaley->GetValue()); // Update UI updateTextureScaleLabel(); tex_canvas->redraw(); tex_modified = true; }
/* TextureEditorPanel::updateTextureControls * Updates all texture editing controls with values from the texture *******************************************************************/ void TextureEditorPanel::updateTextureControls() { // Check texture is open if (!tex_current) return; text_tex_name->SetValue(tex_current->getName()); spin_tex_width->SetValue(tex_current->getWidth()); spin_tex_height->SetValue(tex_current->getHeight()); spin_tex_scalex->SetValue(tex_current->getScaleX()*8); spin_tex_scaley->SetValue(tex_current->getScaleY()*8); cb_tex_world_panning->SetValue(tex_current->worldPanning()); updateTextureScaleLabel(); }