소스 검색

forget the empty template XD added delete demo function

John3 9 년 전
부모
커밋
100e18d232
2개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      Templates/Empty/game/core/art/gui/RecordingsDlg.gui
  2. 16 0
      Templates/Empty/game/core/scripts/client/recordings.cs

+ 1 - 0
Templates/Empty/game/core/art/gui/RecordingsDlg.gui

@@ -217,6 +217,7 @@
          profile = "GuiButtonProfile";
          visible = "1";
          active = "1";
+         command = "deleteDemoRecord();";
          tooltipProfile = "GuiToolTipProfile";
          hovertime = "1000";
          isContainer = "0";

+ 16 - 0
Templates/Empty/game/core/scripts/client/recordings.cs

@@ -134,3 +134,19 @@ function demoPlaybackComplete()
 
    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);
+}