mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
This makes some tweaks to the engine to support this, specifically, it tweaks the hardcoded shaderpaths to defer to a pref variable, so none of the shader paths are hardcoded. Also tweaks how post effects read in texture files, removing a bizzare filepath interpretation choice, where if the file path didn't start with "/" it forcefully appended the script's file path. This made it impossible to have images not in the same dir as the script file defining the post effect. This was changed and the existing template's post effects tweaked for now to just add "./" to those few paths impacted, as well as the perf vars to support the non-hardcoded shader paths in the engine.
180 lines
No EOL
5.3 KiB
Text
180 lines
No EOL
5.3 KiB
Text
//--- OBJECT WRITE BEGIN ---
|
|
%guiContent = new GuiControl(MessageBoxSaveChangesDlg, EditorGuiGroup) {
|
|
canSaveDynamicFields = "0";
|
|
Profile = "ToolsGuiDefaultProfile";
|
|
HorizSizing = "width";
|
|
VertSizing = "height";
|
|
position = "0 0";
|
|
Extent = "1024 768";
|
|
MinExtent = "8 8";
|
|
canSave = "1";
|
|
Visible = "1";
|
|
hovertime = "1000";
|
|
|
|
new GuiWindowCtrl(MBSaveChangesFrame) {
|
|
canSaveDynamicFields = "0";
|
|
Profile = "ToolsGuiWindowProfile";
|
|
HorizSizing = "center";
|
|
VertSizing = "center";
|
|
position = "362 274";
|
|
Extent = "340 164";
|
|
MinExtent = "48 92";
|
|
canSave = "1";
|
|
Visible = "1";
|
|
hovertime = "1000";
|
|
text = "Save Changes";
|
|
maxLength = "255";
|
|
resizeWidth = "1";
|
|
resizeHeight = "1";
|
|
canMove = "1";
|
|
canClose = "0";
|
|
canMinimize = "0";
|
|
canMaximize = "0";
|
|
minSize = "50 50";
|
|
|
|
new GuiIconButtonCtrl(mbSaveDlgSaveButton) {
|
|
canSaveDynamicFields = "0";
|
|
Profile = "ToolsGuiButtonProfile";
|
|
HorizSizing = "right";
|
|
VertSizing = "bottom";
|
|
position = "240 117";
|
|
Extent = "83 25";
|
|
MinExtent = "8 2";
|
|
canSave = "1";
|
|
Visible = "1";
|
|
hovertime = "1000";
|
|
text = "Save";
|
|
groupNum = "-1";
|
|
buttonType = "PushButton";
|
|
iconBitmap = "~/levelEditor/gui/images/iconAccept.png";
|
|
sizeIconToButton = "0";
|
|
textLocation = "Center";
|
|
textMargin = "4";
|
|
buttonMargin = "4 4";
|
|
};
|
|
new GuiIconButtonCtrl(mbSaveDlgCancelButton) {
|
|
canSaveDynamicFields = "0";
|
|
Profile = "ToolsGuiButtonProfile";
|
|
HorizSizing = "right";
|
|
VertSizing = "bottom";
|
|
position = "158 117";
|
|
Extent = "83 25";
|
|
MinExtent = "8 2";
|
|
canSave = "1";
|
|
Visible = "1";
|
|
hovertime = "1000";
|
|
text = "Cancel";
|
|
groupNum = "-1";
|
|
buttonType = "PushButton";
|
|
iconBitmap = "~/levelEditor/gui/images/iconCancel.png";
|
|
sizeIconToButton = "0";
|
|
textLocation = "Center";
|
|
textMargin = "4";
|
|
buttonMargin = "4 4";
|
|
};
|
|
new GuiIconButtonCtrl(mbSaveDlgDontButton) {
|
|
canSaveDynamicFields = "0";
|
|
Profile = "ToolsGuiButtonProfile";
|
|
HorizSizing = "right";
|
|
VertSizing = "bottom";
|
|
position = "14 117";
|
|
Extent = "124 25";
|
|
MinExtent = "8 2";
|
|
canSave = "1";
|
|
Visible = "1";
|
|
hovertime = "1000";
|
|
text = "Don\'t Save";
|
|
groupNum = "-1";
|
|
buttonType = "PushButton";
|
|
sizeIconToButton = "0";
|
|
textLocation = "Center";
|
|
textMargin = "4";
|
|
buttonMargin = "4 4";
|
|
};
|
|
new GuiControl() {
|
|
canSaveDynamicFields = "0";
|
|
Profile = "ToolsGuiDefaultProfile";
|
|
HorizSizing = "right";
|
|
VertSizing = "bottom";
|
|
position = "13 31";
|
|
Extent = "310 73";
|
|
MinExtent = "8 2";
|
|
canSave = "1";
|
|
Visible = "1";
|
|
hovertime = "1000";
|
|
|
|
new GuiTextCtrl() {
|
|
canSaveDynamicFields = "0";
|
|
Profile = "EditorTextHLBoldLeft";
|
|
HorizSizing = "right";
|
|
VertSizing = "bottom";
|
|
position = "15 9";
|
|
Extent = "281 26";
|
|
MinExtent = "8 2";
|
|
canSave = "1";
|
|
Visible = "1";
|
|
hovertime = "1000";
|
|
text = "Do you want to save changes to this document?";
|
|
maxLength = "1024";
|
|
};
|
|
new GuiTextCtrl() {
|
|
canSaveDynamicFields = "0";
|
|
Profile = "ToolsGuiDefaultProfile";
|
|
HorizSizing = "right";
|
|
VertSizing = "bottom";
|
|
position = "15 38";
|
|
Extent = "258 21";
|
|
MinExtent = "8 2";
|
|
canSave = "1";
|
|
Visible = "1";
|
|
hovertime = "1000";
|
|
text = "If you don\'t save, your changes may be lost.";
|
|
maxLength = "1024";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
//--- OBJECT WRITE END ---
|
|
|
|
function MessageBoxSaveChangesDlg::onWake( %this )
|
|
{
|
|
MBSaveChangesFrame.setText( %this.Data );
|
|
}
|
|
|
|
function mbSaveDlgSaveButton::onClick( %this )
|
|
{
|
|
if( MessageBoxSaveChangesDlg.SaveCallback !$= "" )
|
|
eval( MessageBoxSaveChangesDlg.SaveCallback @ "(" @ MessageBoxSaveChangesDlg.Data @ ");" );
|
|
Canvas.popDialog( MessageBoxSaveChangesDlg );
|
|
}
|
|
|
|
function mbSaveDlgCancelButton::onClick( %this )
|
|
{
|
|
Canvas.popDialog( MessageBoxSaveChangesDlg );
|
|
}
|
|
|
|
function mbSaveDlgDontButton::onClick( %this )
|
|
{
|
|
if( MessageBoxSaveChangesDlg.DontSaveCallback !$= "" )
|
|
eval( MessageBoxSaveChangesDlg.DontSaveCallback @ "(" @ MessageBoxSaveChangesDlg.Data @ ");" );
|
|
Canvas.popDialog( MessageBoxSaveChangesDlg );
|
|
}
|
|
|
|
// Deprecated when platform layers are all sufficient
|
|
function checkSaveChangesOld( %data, %saveCallback, %dontSaveCallback )
|
|
{
|
|
// Sanity Check
|
|
if( MessageBoxSaveChangesDlg.isAwake() )
|
|
{
|
|
warn("Save Changes Dialog already Awake, NOT creating second instance.");
|
|
return;
|
|
}
|
|
|
|
// Set Proper State
|
|
MessageBoxSaveChangesDlg.SaveCallback = %saveCallback;
|
|
MessageBoxSaveChangesDlg.DontSaveCallback = %dontSaveCallback;
|
|
MessageBoxSaveChangesDlg.Data = %data;
|
|
|
|
// Show Dialog
|
|
Canvas.pushDialog( MessageBoxSaveChangesDlg );
|
|
} |