Advertisement
JcdShrimp

Addon Assistant v0.2

Apr 8th, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5.50 KB | None | 0 0
  1. <!--By Julian Drake-->
  2.  
  3.  
  4. <html>
  5. <body style="background-image:url(https://www.xmple.com/wallpaper/orange-graph-paper-white-grid-3840x2160-c2-ff6347-ffffff-l2-8-341-a-60-f-20.svg);">
  6. <script src="jscolor.js"></script>
  7.  
  8. <head>
  9. <title>gmod2D Addon Assistant</title>
  10. </head>
  11.  
  12. <body>
  13. <FONT FACE="Verdana, arial, modern">
  14.  
  15. <h1><strong>gmod2D Addon Assistant 0.2</strong></h1>
  16. <h3><i>A tool designed to assist in the creation of gmod2D addons.</1></h2>
  17.  
  18. <table>
  19.     <tr>
  20.         <td colspan="3">
  21.             <textarea id="inputTextToSave" cols="50" rows="1" placeholder="Weapon Slot ID"></textarea>
  22.             The ID value of the weapon.
  23.         </td>
  24.     </tr>
  25.     <tr>
  26.         <td colspan="3">
  27.             <textarea id="inputTextToSave2" cols="50" rows="1" placeholder="Weapon Name"></textarea>
  28.             The weapon's name.
  29.         </td>
  30.     </tr>
  31.     <tr>
  32.         <td colspan="3">
  33.             <textarea id="inputTextToSave3" cols="50" rows="1" placeholder="Weapon Damage"></textarea>
  34.             The weapon's damage. (Enemies have 100 health.)
  35.         </td>
  36.     </tr>
  37.         <tr>
  38.         <td colspan="3">
  39.             <textarea id="inputTextToSave4" cols="50" rows="1" placeholder="Bullet Speed"></textarea>
  40.             The amount of pixels a bullet travels in 1 frame.
  41.         </td>
  42.     </tr>
  43.         <tr>
  44.         <td colspan="3">
  45.        
  46.  
  47.     <select id="inputTextToSave5">
  48.       <option value="pistol_fire2">Pistol Fire</option>
  49.       <option value="smg1_fire1">SMG Fire</option>
  50.       <option value="shotgun_fire6">Shotgun Fire</option>
  51.       <option value="shotgun_cock">Shotgun Cock</option>
  52.       <option value="ar1_dist1">AR2 Fire</option>
  53.       <option value="portalgun_shoot_blue1">Blue Portal Fire</option>
  54.       <option value="portalgun_shoot_red1">Orange Portal Fire</option>
  55.       <option value="crossbow_fire">Crossbow Fire</option>
  56.       <option value="step_floor">Step</option>
  57.       <option value="suit_sprint">Sprint</option>
  58.     </select>
  59.  
  60.     </div>
  61.             The weapon's firing sound. Must already exist in the game.
  62.         </td>
  63.         <tr>
  64.         <td colspan="3">
  65.             <input id = "inputTextToSaveHex" type="color"  value="#ffffff" /> The bullet's color.
  66.         </td>
  67.     </tr>
  68.     <tr>
  69.         <td colspan="3">
  70.             <textarea id="inputTextToSave9" cols="50" rows="1" placeholder="Weapon Delay"></textarea>
  71.             The delay (in steps) between shots.
  72.         </td>
  73.     </tr>
  74.     <tr>
  75.         <td colspan="3">
  76.                 <select id="inputTextToSave10">
  77.           <option value="0">Pistol</option>
  78.           <option value="1">SMG</option>
  79.           <option value="2">Shotgun</option>
  80.           <option value="3">AR2</option>
  81.           <option value="4">Gravity Gun</option>
  82.           <option value="5">Toolgun</option>
  83.           <option value="6">Portal Gun</option>
  84.           <option value="7">Crossbow</option>
  85.     </select>
  86.             The weapon will imitate the sprite of this other weapon.
  87.         </td>
  88.     </tr>
  89.     <tr>
  90.         <td colspan="3">
  91.             <textarea id="inputTextToSaveMulti" cols="50" rows="1" placeholder="Multiple Bullets"></textarea>
  92.             Can this weapon shoot multiple bullets? (True/False)
  93.         </td>
  94.     </tr>
  95.         <tr>
  96.         <td colspan="3">
  97.             <textarea id="inputTextToSave11" cols="50" rows="1" placeholder="Addon Name"></textarea>
  98.             The name of this addon.
  99.         </td>
  100.     </tr>
  101.         <tr>
  102.         <td colspan="3">
  103.             <textarea id="inputTextToSave12" cols="50" rows="1" placeholder="Addon Author"></textarea>
  104.             The author of this addon.
  105.         </td>
  106.     </tr>
  107.     <tr>
  108.         <td>Filename to Save As:</td>
  109.         <td><input id="inputFileNameToSaveAs"></input></td>
  110.         <td><button onclick="saveTextAsFile()">Save Text to File</button></td>
  111.     </tr>
  112.  
  113. </table>
  114.  </FONT>
  115. <script type="text/javascript">
  116.  
  117. function saveTextAsFile()
  118. {
  119.  
  120.    
  121.     var textToSave = "script_type = weaponscript1"+ "\r\n"+document.getElementById("inputTextToSave").value + "\r\n"+document.getElementById("inputTextToSave2").value+ "\r\n"+document.getElementById("inputTextToSave3").value+ "\r\n"+document.getElementById("inputTextToSave4").value+ "\r\n"+document.getElementById("inputTextToSave5").value+ "\r\n"+document.getElementById("inputTextToSaveHex").value+ "\r\n"+document.getElementById("inputTextToSave9").value+ "\r\n"+document.getElementById("inputTextToSave10").value+ "\r\n"+document.getElementById("inputTextToSaveMulti").value+"\r\n"+document.getElementById("inputTextToSave11").value+ "\r\n"+document.getElementById("inputTextToSave12").value;
  122.     var textToSaveAsBlob = new Blob([textToSave], {type:"text/plain"});
  123.     var textToSaveAsURL = window.URL.createObjectURL(textToSaveAsBlob);
  124.     var fileNameToSaveAs = document.getElementById("inputFileNameToSaveAs").value+".gsc";
  125.  
  126.     var downloadLink = document.createElement("a");
  127.     downloadLink.download = fileNameToSaveAs;
  128.     downloadLink.innerHTML = "Download File";
  129.     downloadLink.href = textToSaveAsURL;
  130.     downloadLink.onclick = destroyClickedElement;
  131.     downloadLink.style.display = "none";
  132.     document.body.appendChild(downloadLink);
  133.  
  134.     downloadLink.click();
  135. }
  136.  
  137. function destroyClickedElement(event)
  138. {
  139.     document.body.removeChild(event.target);
  140. }
  141.  
  142. function loadFileAsText()
  143. {
  144.     var fileToLoad = document.getElementById("fileToLoad").files[0];
  145.  
  146.     var fileReader = new FileReader();
  147.     fileReader.onload = function(fileLoadedEvent)
  148.     {
  149.         var textFromFileLoaded = fileLoadedEvent.target.result;
  150.         document.getElementById("inputTextToSave").value = textFromFileLoaded;
  151.     };
  152.     fileReader.readAsText(fileToLoad, "UTF-8");
  153. }
  154.  
  155. </script>
  156.  
  157. </body>
  158. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement