Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--By Julian Drake-->
- <html>
- <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);">
- <script src="jscolor.js"></script>
- <head>
- <title>gmod2D Addon Assistant</title>
- </head>
- <body>
- <FONT FACE="Verdana, arial, modern">
- <h1><strong>gmod2D Addon Assistant 0.2</strong></h1>
- <h3><i>A tool designed to assist in the creation of gmod2D addons.</1></h2>
- <table>
- <tr>
- <td colspan="3">
- <textarea id="inputTextToSave" cols="50" rows="1" placeholder="Weapon Slot ID"></textarea>
- The ID value of the weapon.
- </td>
- </tr>
- <tr>
- <td colspan="3">
- <textarea id="inputTextToSave2" cols="50" rows="1" placeholder="Weapon Name"></textarea>
- The weapon's name.
- </td>
- </tr>
- <tr>
- <td colspan="3">
- <textarea id="inputTextToSave3" cols="50" rows="1" placeholder="Weapon Damage"></textarea>
- The weapon's damage. (Enemies have 100 health.)
- </td>
- </tr>
- <tr>
- <td colspan="3">
- <textarea id="inputTextToSave4" cols="50" rows="1" placeholder="Bullet Speed"></textarea>
- The amount of pixels a bullet travels in 1 frame.
- </td>
- </tr>
- <tr>
- <td colspan="3">
- <select id="inputTextToSave5">
- <option value="pistol_fire2">Pistol Fire</option>
- <option value="smg1_fire1">SMG Fire</option>
- <option value="shotgun_fire6">Shotgun Fire</option>
- <option value="shotgun_cock">Shotgun Cock</option>
- <option value="ar1_dist1">AR2 Fire</option>
- <option value="portalgun_shoot_blue1">Blue Portal Fire</option>
- <option value="portalgun_shoot_red1">Orange Portal Fire</option>
- <option value="crossbow_fire">Crossbow Fire</option>
- <option value="step_floor">Step</option>
- <option value="suit_sprint">Sprint</option>
- </select>
- </div>
- The weapon's firing sound. Must already exist in the game.
- </td>
- <tr>
- <td colspan="3">
- <input id = "inputTextToSaveHex" type="color" value="#ffffff" /> The bullet's color.
- </td>
- </tr>
- <tr>
- <td colspan="3">
- <textarea id="inputTextToSave9" cols="50" rows="1" placeholder="Weapon Delay"></textarea>
- The delay (in steps) between shots.
- </td>
- </tr>
- <tr>
- <td colspan="3">
- <select id="inputTextToSave10">
- <option value="0">Pistol</option>
- <option value="1">SMG</option>
- <option value="2">Shotgun</option>
- <option value="3">AR2</option>
- <option value="4">Gravity Gun</option>
- <option value="5">Toolgun</option>
- <option value="6">Portal Gun</option>
- <option value="7">Crossbow</option>
- </select>
- The weapon will imitate the sprite of this other weapon.
- </td>
- </tr>
- <tr>
- <td colspan="3">
- <textarea id="inputTextToSaveMulti" cols="50" rows="1" placeholder="Multiple Bullets"></textarea>
- Can this weapon shoot multiple bullets? (True/False)
- </td>
- </tr>
- <tr>
- <td colspan="3">
- <textarea id="inputTextToSave11" cols="50" rows="1" placeholder="Addon Name"></textarea>
- The name of this addon.
- </td>
- </tr>
- <tr>
- <td colspan="3">
- <textarea id="inputTextToSave12" cols="50" rows="1" placeholder="Addon Author"></textarea>
- The author of this addon.
- </td>
- </tr>
- <tr>
- <td>Filename to Save As:</td>
- <td><input id="inputFileNameToSaveAs"></input></td>
- <td><button onclick="saveTextAsFile()">Save Text to File</button></td>
- </tr>
- </table>
- </FONT>
- <script type="text/javascript">
- function saveTextAsFile()
- {
- 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;
- var textToSaveAsBlob = new Blob([textToSave], {type:"text/plain"});
- var textToSaveAsURL = window.URL.createObjectURL(textToSaveAsBlob);
- var fileNameToSaveAs = document.getElementById("inputFileNameToSaveAs").value+".gsc";
- var downloadLink = document.createElement("a");
- downloadLink.download = fileNameToSaveAs;
- downloadLink.innerHTML = "Download File";
- downloadLink.href = textToSaveAsURL;
- downloadLink.onclick = destroyClickedElement;
- downloadLink.style.display = "none";
- document.body.appendChild(downloadLink);
- downloadLink.click();
- }
- function destroyClickedElement(event)
- {
- document.body.removeChild(event.target);
- }
- function loadFileAsText()
- {
- var fileToLoad = document.getElementById("fileToLoad").files[0];
- var fileReader = new FileReader();
- fileReader.onload = function(fileLoadedEvent)
- {
- var textFromFileLoaded = fileLoadedEvent.target.result;
- document.getElementById("inputTextToSave").value = textFromFileLoaded;
- };
- fileReader.readAsText(fileToLoad, "UTF-8");
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement