F95 Quick Game Templates

Adds more action buttons to the toolbar when making a game request on f95.

  1. // ==UserScript==
  2. // @name F95 Quick Game Templates
  3. // @namespace 1330126-edexal
  4. // @match *://f95zone.to/forums/game-requests.3/post-thread*
  5. // @icon https://external-content.duckduckgo.com/ip3/f95zone.to.ico
  6. // @grant none
  7. // @version 1.1.1
  8. // @author Edexal
  9. // @license Unlicense
  10. // @description Adds more action buttons to the toolbar when making a game request on f95.
  11. // ==/UserScript==
  12. (() => {
  13. let styleCSS = `
  14. .edexal-btn{
  15. color:yellow !important;
  16. }
  17. `;
  18. const NEW_TEMPLATE = { title: "[GAME ENGINE] Game Name [Version][Developer]",
  19. body: `[CENTER](COVER ART; DELETE THIS)
  20.  
  21. [B]Overview:[/B]
  22. (STORY OVERVIEW GOES HERE AND USE A SPOILER TAG IN-CASE OF A WALL OF TEXT; DELETE THIS)[/CENTER]
  23.  
  24. [B]Thread Updated[/B]: (USE "YYYY-MM-DD" NUMBERS ONLY, DATE ADDED TO F95ZONE ; DELETE THIS)
  25. [B]Release Date[/B]: (USE "YYYY-MM-DD" NUMBERS ONLY, DATE RELEASE BY DEV; DELETE THIS)
  26. [B]Developer[/B]: Patreon - Website
  27. [B]Censored[/B]:
  28. [B]Version[/B]:
  29. [B]OS[/B]: (REN'PY GAMES WITH "PC" IN THE TITLE INCLUDE BOTH WINDOWS + LINUX, MAKE SURE TO TYPE BOTH; DELETE THIS)
  30. [B]Language[/B]: English
  31. [B]Genre[/B]:
  32. [SPOILER]
  33. (GENRE TAGS HERE, CAPITALIZE EACH TAG FOR PARITY, DELETE THIS)
  34. [/SPOILER]
  35.  
  36. [B]Installation[/B]:
  37. [SPOILER]
  38. 1. Extract and run.
  39. [/SPOILER]
  40.  
  41. [B]Changelog[/B]:
  42. [SPOILER]
  43. (CHANGELOG GOES HERE. IF NO CHANGELOG IS AVAILABLE, USE "vX.XX Release" OR SIMILAR; DELETE THIS LINE)
  44. [/SPOILER]
  45.  
  46. [B]Developer Notes[/B]:
  47. [SPOILER]
  48. (IN CASE THE DEVELOPER WISHES TO SHARE SOME INFO REGARDING THE GAME; DELETE THIS ENTIRE BLOCK IF NONE)
  49. [/SPOILER]
  50.  
  51. (ADD ANY OTHER BLOCK FOLLOWING THE SAME FORMATTING AS ABOVE IF NECESSARY HERE; DELETE THIS LINE)
  52. [CENTER][B][SIZE=6]DOWNLOAD[/SIZE][/B]
  53. [SIZE=5][B]Win[/B]: TORRENT - MIRROR - MIRROR - MIRROR
  54. [B]Linux[/B]: TORRENT - MIRROR - MIRROR - MIRROR
  55. [B]Mac[/B]: TORRENT - MIRROR - MIRROR - MIRROR
  56. [B]Others[/B]: COMPRESSED - ANDROID (OR UNOFFICIAL ANDROID)
  57.  
  58. [B]Patches[/B]: INCEST PATCH - BUGFIX
  59. [B]Extras[/B]: WALKTHROUGH - 100% SAVE - MOD - MOD2 - MOD3[/SIZE]
  60. [SIZE=1](THANK YOU NOTES AND UNOFFICIAL ANDROID MESSAGE GOES, ALWAYS AT THE VERY BOTTOM OF ALL DL LINKS; EXAMPLE: "Unofficial build by [USER=1]@F95[/USER]. Thank you [USER=2222]@Bloo[/USER] for sharing the game and [USER=92]@TCMS[/USER] for the walkthrough."; DELETE THIS LINE)[/SIZE]
  61.  
  62. (SAMPLES/SCREENSHOTS; DELETE THIS)[/CENTER]`};
  63. const REQ_TEMPLATE = {title:"[Store][$Price] Game Name [Version][Developer]",
  64. body: `Title:
  65. Developer website:
  66. Language:
  67. Samples:
  68.  
  69. [CENTER][B][COLOR=#ff0000]Rules - Remove this before posting.[/COLOR][/B][/CENTER]
  70. *Any Online only or Multiplayer requests will be denied and deleted.
  71. *Don't ask for games that haven't been released yet.
  72. *Don't request more than 1 game per request (this includes siterip).
  73. *If the game is a translated game (from any language to English) a link to the translator page is required like [URL='https://ulmf.org/']ULMF[/URL] links, if not, it's not required.`};
  74. const UPDATE_TEMPLATE = {title:"[Store][$Price] Game Name [Version][Developer]",
  75. body:`Title:
  76. Thread: (link to thread on F95zone)
  77. Developer website:
  78. Version:
  79.  
  80. [CENTER][B][COLOR=#ff0000]Rules - Remove this before posting.[/COLOR][/B][/CENTER]
  81. *Any Online only or Multiplayer requests will be denied and deleted.
  82. *Don't ask for games that haven't been released yet.
  83. *Don't request more than 1 game per request (this includes siterip).
  84. *If the game is a translated game (from any language to English) a link to the translator page is required like [URL='https://ulmf.org/']ULMF[/URL] links, if not, it's not required.`};
  85. //Apply custom styles in a style tag
  86. function applyCSS(css) {
  87. let styleEl = document.querySelector("style");
  88. if (styleEl === null) {
  89. styleEl = document.createElement('style');
  90. }
  91. styleEl.appendChild(document.createTextNode(css));
  92. document.head.appendChild(styleEl);
  93. }
  94. function addButton(){
  95. let toolbarEl = document.querySelector('.fr-toolbar');
  96. toolbarEl.insertAdjacentHTML('beforeend','<div class="fr-separator fr-vs" role="separator" aria-orientation="vertical"></div>' +
  97. '<button aria-controls="dropdown-menu-xfTemp-1" aria-expanded="false" aria-haspopup="false" class="fr-command fr-btn fr-dropdown fr-btn-font_awesome edexal-btn" data-cmd="xfTemp"\n' +
  98. ' id="xfTemp-1" role="button" tabindex="-1"\n' +
  99. ' type="button" title="Templates">\n' +
  100. ' <i aria-hidden="true" class="fas fa-file-word"></i>\n' +
  101. ' <span class="fr-sr-only">Templates</span>\n' +
  102. '</button>\n' +
  103. '<div aria-hidden="true" aria-labelledby="xfTemp-1" class="fr-dropdown-menu" id="dropdown-menu-xfTemp-1" role="listbox">\n' +
  104. ' <div class="fr-dropdown-wrapper" role="presentation">\n' +
  105. ' <div class="fr-dropdown-content" role="presentation">\n' +
  106. ' <ul class="fr-dropdown-list" role="presentation">\n' +
  107. ' <li role="presentation"><a class="fr-command" data-cmd="xfTemp" data-param1="xfTempNew" role="option"\n' +
  108. ' tabindex="-1" title="New Game Template">New Game Template</a></li>\n' +
  109. ' <li role="presentation"><a class="fr-command" data-cmd="xfTemp" data-param1="xfTempReq" role="option"\n' +
  110. ' tabindex="-1" title="Request Game Template">Request Game Template</a></li>\n' +
  111. ' <li role="presentation"><a class="fr-command" data-cmd="xfTemp" data-param1="xfTempUpdate" role="option"\n' +
  112. ' tabindex="-1" title="Update Game Template">Update Game Template</a></li>\n' +
  113. ' </ul>\n' +
  114. ' </div>\n' +
  115. ' </div>\n' +
  116. '</div>' +
  117. '<button id="xfTagList-1" title="Go To Tag List" type="button" tabindex="-1" role="button" class="fr-command fr-btn fr-btn-xf_font_awesome_5 edexal-btn" data-cmd="xfTagList"><i class="far fa-tags" aria-hidden="true"></i><span class="fr-sr-only">Go To Tag List</span></button>');
  118. }
  119. function refreshTextArea(){
  120. let textAreaEl = document.querySelector(".fr-element") //Text Area Element
  121. textAreaEl.replaceChildren();//Text Area Element
  122. let preEl = document.createElement("pre");
  123. textAreaEl.append(preEl); //Text Area Element
  124. }
  125.  
  126. function displayTextClick(e,template){
  127. refreshTextArea();
  128. let txt = document.createTextNode(template.body);
  129. document.querySelector(".fr-element").firstElementChild.append(txt); //Text Area Element
  130. document.querySelector('#xfTemp-1').classList.remove('fr-active','fr-selected');
  131. e.target.classList.remove('fr-selected');
  132. document.querySelector('[placeholder~=title]').value = template.title; //Thread title Element
  133. }
  134. function goToTagListClick(e){
  135. window.open("https://f95zone.to/threads/tags-rules-and-list-updated-2024-01-29.10394");
  136. }
  137.  
  138. function run(){
  139. applyCSS(styleCSS);
  140. addButton();
  141. document.querySelector('[title=\"New Game Template\"]').addEventListener('click',(e) => displayTextClick(e,NEW_TEMPLATE));
  142. document.querySelector('[title=\"Request Game Template\"]').addEventListener('click',(e) => displayTextClick(e,REQ_TEMPLATE));
  143. document.querySelector('[title=\"Update Game Template\"]').addEventListener('click',(e) => displayTextClick(e,UPDATE_TEMPLATE));
  144. document.querySelector('#xfTagList-1').addEventListener('click',(e) => goToTagListClick(e));
  145. }
  146. setTimeout(run,2500);
  147. })();