mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 08:15:44 +00:00
Clean up more evals that have local variables are not working correctly.
This commit is contained in:
parent
a30f64506f
commit
7556e403e7
6 changed files with 27 additions and 29 deletions
|
|
@ -1124,13 +1124,13 @@ function MaterialEditorGui::updateActiveMaterial(%this, %propertyField, %value,
|
|||
MaterialEditorGui.submitUndo( %action );
|
||||
}
|
||||
|
||||
eval("materialEd_previewMaterial." @ %propertyField @ " = " @ %value @ ";");
|
||||
materialEd_previewMaterial.setFieldValue(%propertyField, %value);
|
||||
materialEd_previewMaterial.flush();
|
||||
materialEd_previewMaterial.reload();
|
||||
|
||||
if (MaterialEditorGui.livePreview == true)
|
||||
{
|
||||
eval("MaterialEditorGui.currentMaterial." @ %propertyField @ " = " @ %value @ ";");
|
||||
MaterialEditorGui.setFieldValue(%propertyField, %value);
|
||||
MaterialEditorGui.currentMaterial.flush();
|
||||
MaterialEditorGui.currentMaterial.reload();
|
||||
}
|
||||
|
|
@ -1173,7 +1173,7 @@ function MaterialEditorGui::updateMaterialReferences( %this, %obj, %oldName, %ne
|
|||
%fieldName = %obj.getField( %i );
|
||||
if ( ( %obj.getFieldType( %fieldName ) $= "TypeMaterialName" ) && ( %obj.getFieldValue( %fieldName ) $= %oldName ) )
|
||||
{
|
||||
eval( %obj @ "." @ %fieldName @ " = " @ %newName @ ";" );
|
||||
%obj.setFieldValue(%fieldName, %newName);
|
||||
%objChanged = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1431,13 +1431,13 @@ function MaterialEditorGui::updateAnimationFlags(%this)
|
|||
%action.oldValue = %oldFlags;
|
||||
MaterialEditorGui.submitUndo( %action );
|
||||
|
||||
eval("materialEd_previewMaterial.animFlags[" @ MaterialEditorGui.currentLayer @ "] = " @ %flags @ ";");
|
||||
materialEd_previewMaterial.animFlags[MaterialEditorGui.currentLayer] = %flags;
|
||||
materialEd_previewMaterial.flush();
|
||||
materialEd_previewMaterial.reload();
|
||||
|
||||
if (MaterialEditorGui.livePreview == true)
|
||||
{
|
||||
eval("MaterialEditorGui.currentMaterial.animFlags[" @ MaterialEditorGui.currentLayer @ "] = " @ %flags @ ";");
|
||||
MaterialEditorGui.currentMaterial.animFlags[MaterialEditorGui.currentLayer] = %flags;
|
||||
MaterialEditorGui.currentMaterial.flush();
|
||||
MaterialEditorGui.currentMaterial.reload();
|
||||
}
|
||||
|
|
@ -2324,7 +2324,7 @@ function MaterialEditorGui::changeMaterial(%this, %fromMaterial, %toMaterial)
|
|||
{
|
||||
%action.mode = "editorShapes";
|
||||
|
||||
eval("MaterialEditorGui.currentObject." @ SubMaterialSelector.getText() @ " = " @ %toMaterial.getName() @ ";");
|
||||
MaterialEditorGui.currentObject.setFieldValue(SubMaterialSelector.getText(), %toMaterial.getName());
|
||||
if( MaterialEditorGui.currentObject.isMethod("postApply") )
|
||||
MaterialEditorGui.currentObject.postApply();
|
||||
|
||||
|
|
|
|||
|
|
@ -62,13 +62,13 @@ function ActionUpdateActiveMaterial::redo(%this)
|
|||
MaterialEditorGui.setActiveMaterial(%this.material);
|
||||
}
|
||||
*/
|
||||
eval("materialEd_previewMaterial." @ %this.field @ " = " @ %this.newValue @ ";");
|
||||
materialEd_previewMaterial.setFieldValue(%this.field, %this.newValue);
|
||||
materialEd_previewMaterial.flush();
|
||||
materialEd_previewMaterial.reload();
|
||||
|
||||
if (MaterialEditorGui.livePreview == true)
|
||||
{
|
||||
eval("%this.material." @ %this.field @ " = " @ %this.newValue @ ";");
|
||||
%this.material.setFieldValue(%this.field, %this.newValue);
|
||||
MaterialEditorGui.currentMaterial.flush();
|
||||
MaterialEditorGui.currentMaterial.reload();
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ function ActionUpdateActiveMaterial::redo(%this)
|
|||
}
|
||||
else
|
||||
{
|
||||
eval("%this.material." @ %this.field @ " = " @ %this.newValue @ ";");
|
||||
%this.material.setFieldValue(%this.field, %this.newValue);
|
||||
%this.material.flush();
|
||||
%this.material.reload();
|
||||
}
|
||||
|
|
@ -100,13 +100,13 @@ function ActionUpdateActiveMaterial::undo(%this)
|
|||
}
|
||||
*/
|
||||
|
||||
eval("materialEd_previewMaterial." @ %this.field @ " = " @ %this.oldValue @ ";");
|
||||
materialEd_previewMaterial.setFieldValue(%this.field, %this.oldValue);
|
||||
materialEd_previewMaterial.flush();
|
||||
materialEd_previewMaterial.reload();
|
||||
|
||||
if (MaterialEditorGui.livePreview == true)
|
||||
{
|
||||
eval("%this.material." @ %this.field @ " = " @ %this.oldValue @ ";");
|
||||
%this.material.setFieldValue(%this.field, %this.oldValue);
|
||||
MaterialEditorGui.currentMaterial.flush();
|
||||
MaterialEditorGui.currentMaterial.reload();
|
||||
}
|
||||
|
|
@ -115,7 +115,7 @@ function ActionUpdateActiveMaterial::undo(%this)
|
|||
}
|
||||
else
|
||||
{
|
||||
eval("%this.material." @ %this.field @ " = " @ %this.oldValue @ ";");
|
||||
%this.material.setFieldValue(%this.field, %this.oldValue);
|
||||
%this.material.flush();
|
||||
%this.material.reload();
|
||||
}
|
||||
|
|
@ -138,13 +138,13 @@ function ActionUpdateActiveMaterialAnimationFlags::redo(%this)
|
|||
}
|
||||
*/
|
||||
|
||||
eval("materialEd_previewMaterial.animFlags[" @ %this.layer @ "] = " @ %this.newValue @ ";");
|
||||
materialEd_previewMaterial.animFlags[%this.layer] = %this.newValue;
|
||||
materialEd_previewMaterial.flush();
|
||||
materialEd_previewMaterial.reload();
|
||||
|
||||
if (MaterialEditorGui.livePreview == true)
|
||||
{
|
||||
eval("%this.material.animFlags[" @ %this.layer @ "] = " @ %this.newValue @ ";");
|
||||
%this.material.animFlags[%this.layer] = %this.newValue;
|
||||
MaterialEditorGui.currentMaterial.flush();
|
||||
MaterialEditorGui.currentMaterial.reload();
|
||||
}
|
||||
|
|
@ -153,7 +153,7 @@ function ActionUpdateActiveMaterialAnimationFlags::redo(%this)
|
|||
}
|
||||
else
|
||||
{
|
||||
eval("%this.material.animFlags[" @ %this.layer @ "] = " @ %this.newValue @ ";");
|
||||
%this.material.animFlags[%this.layer] = %this.newValue;
|
||||
%this.material.flush();
|
||||
%this.material.reload();
|
||||
}
|
||||
|
|
@ -162,14 +162,14 @@ function ActionUpdateActiveMaterialAnimationFlags::redo(%this)
|
|||
function ActionUpdateActiveMaterialAnimationFlags::undo(%this)
|
||||
{
|
||||
if( MaterialEditorPreviewWindow.isVisible() && MaterialEditorGui.currentMaterial == %this.material )
|
||||
{
|
||||
eval("materialEd_previewMaterial.animFlags[" @ %this.layer @ "] = " @ %this.oldValue @ ";");
|
||||
{
|
||||
materialEd_previewMaterial.animFlags[%this.layer] = %this.oldValue;
|
||||
materialEd_previewMaterial.flush();
|
||||
materialEd_previewMaterial.reload();
|
||||
|
||||
if (MaterialEditorGui.livePreview == true)
|
||||
{
|
||||
eval("%this.material.animFlags[" @ %this.layer @ "] = " @ %this.oldValue @ ";");
|
||||
%this.material.animFlags[%this.layer] = %this.oldValue;
|
||||
MaterialEditorGui.currentMaterial.flush();
|
||||
MaterialEditorGui.currentMaterial.reload();
|
||||
}
|
||||
|
|
@ -178,7 +178,7 @@ function ActionUpdateActiveMaterialAnimationFlags::undo(%this)
|
|||
}
|
||||
else
|
||||
{
|
||||
eval("%this.material.animFlags[" @ %this.layer @ "] = " @ %this.oldValue @ ";");
|
||||
%this.material.animFlags[%this.layer] = %this.oldValue;
|
||||
%this.material.flush();
|
||||
%this.material.reload();
|
||||
}
|
||||
|
|
@ -340,7 +340,7 @@ function ActionChangeMaterial::redo(%this)
|
|||
}
|
||||
else
|
||||
{
|
||||
eval("%this.object." @ %this.materialTarget @ " = " @ %this.toMaterial.getName() @ ";");
|
||||
%this.object.setFieldValue(%this.materialTarget, %this.toMaterial.getName());
|
||||
MaterialEditorGui.currentObject.postApply();
|
||||
}
|
||||
|
||||
|
|
@ -372,7 +372,7 @@ function ActionChangeMaterial::undo(%this)
|
|||
}
|
||||
else
|
||||
{
|
||||
eval("%this.object." @ %this.materialTarget @ " = " @ %this.fromMaterial.getName() @ ";");
|
||||
%this.object.setFieldValue(%this.materialTarget, %this.fromMaterial.getName());
|
||||
MaterialEditorGui.currentObject.postApply();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue