mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 07:04:36 +00:00
added deleteDemo function
This commit is contained in:
parent
9b8f0eee44
commit
c822d13109
2 changed files with 17 additions and 0 deletions
|
|
@ -217,6 +217,7 @@
|
||||||
profile = "GuiButtonProfile";
|
profile = "GuiButtonProfile";
|
||||||
visible = "1";
|
visible = "1";
|
||||||
active = "1";
|
active = "1";
|
||||||
|
command = "deleteDemoRecord();";
|
||||||
tooltipProfile = "GuiToolTipProfile";
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
isContainer = "0";
|
isContainer = "0";
|
||||||
|
|
|
||||||
|
|
@ -134,3 +134,19 @@ function demoPlaybackComplete()
|
||||||
|
|
||||||
Canvas.pushDialog(RecordingsDlg);
|
Canvas.pushDialog(RecordingsDlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deleteDemoRecord()
|
||||||
|
{
|
||||||
|
%sel = RecordingsDlgList.getSelectedId();
|
||||||
|
%rowText = RecordingsDlgList.getRowTextById(%sel);
|
||||||
|
%file = $currentMod @ "/recordings/" @ getField(%rowText, 0) @ ".rec";
|
||||||
|
|
||||||
|
if(!isfile(%file))
|
||||||
|
{
|
||||||
|
RecordingsDlgList.removeRowById(%sel);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RecordingsDlgList.removeRowById(%sel);
|
||||||
|
fileDelete(%file);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue