F95 Quick Game Templates

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

Per 19-07-2024. Zie de nieuwste versie.

  1. // ==UserScript==
  2. // @name F95 Quick Game Templates
  3. // @namespace f95_quick_game_templates
  4. // @match https://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.0.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 = `[CENTER](COVER ART; DELETE THIS)
  19.  
  20. [B]Overview:[/B]
  21. (STORY OVERVIEW GOES HERE AND USE A SPOILER TAG IN-CASE OF A WALL OF TEXT; DELETE THIS)[/CENTER]
  22.  
  23. [B]Thread Updated[/B]: (USE "YYYY-MM-DD" NUMBERS ONLY, DATE ADDED TO F95ZONE ; DELETE THIS)
  24. [B]Release Date[/B]: (USE "YYYY-MM-DD" NUMBERS ONLY, DATE RELEASE BY DEV; DELETE THIS)
  25. [B]Developer[/B]: Patreon - Website
  26. [B]Censored[/B]:
  27. [B]Version[/B]:
  28. [B]OS[/B]: (REN'PY GAMES WITH "PC" IN THE TITLE INCLUDE BOTH WINDOWS + LINUX, MAKE SURE TO TYPE BOTH; DELETE THIS)
  29. [B]Language[/B]: English
  30. [B]Genre[/B]:
  31. [SPOILER]
  32. (GENRE TAGS HERE, CAPITALIZE EACH TAG FOR PARITY, DELETE THIS)
  33. [/SPOILER]
  34.  
  35. [B]Installation[/B]:
  36. [SPOILER]
  37. 1. Extract and run.
  38. [/SPOILER]
  39.  
  40. [B]Changelog[/B]:
  41. [SPOILER]
  42. (CHANGELOG GOES HERE. IF NO CHANGELOG IS AVAILABLE, USE "vX.XX Release" OR SIMILAR; DELETE THIS LINE)
  43. [/SPOILER]
  44.  
  45. [B]Developer Notes[/B]:
  46. [SPOILER]
  47. (IN CASE THE DEVELOPER WISHES TO SHARE SOME INFO REGARDING THE GAME; DELETE THIS ENTIRE BLOCK IF NONE)
  48. [/SPOILER]
  49.  
  50. (ADD ANY OTHER BLOCK FOLLOWING THE SAME FORMATTING AS ABOVE IF NECESSARY HERE; DELETE THIS LINE)
  51. [CENTER][B][SIZE=6]DOWNLOAD[/SIZE][/B]
  52. [SIZE=5][B]Win[/B]: TORRENT - MIRROR - MIRROR - MIRROR
  53. [B]Linux[/B]: TORRENT - MIRROR - MIRROR - MIRROR
  54. [B]Mac[/B]: TORRENT - MIRROR - MIRROR - MIRROR
  55. [B]Others[/B]: COMPRESSED - ANDROID (OR UNOFFICIAL ANDROID)
  56.  
  57. [B]Patches[/B]: INCEST PATCH - BUGFIX
  58. [B]Extras[/B]: WALKTHROUGH - 100% SAVE - MOD - MOD2 - MOD3[/SIZE]
  59. [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]
  60.  
  61. (SAMPLES/SCREENSHOTS; DELETE THIS)[/CENTER]`;
  62. const REQ_TEMPLATE = `Title:
  63. Developer website:
  64. Language:
  65. Samples:
  66.  
  67. [CENTER][B][COLOR=#ff0000]Rules - Remove this before posting.[/COLOR][/B][/CENTER]
  68. *Any Online only or Multiplayer requests will be denied and deleted.
  69. *Don't ask for games that haven't been released yet.
  70. *Don't request more than 1 game per request (this includes siterip).
  71. *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.`;
  72. const UPDATE_TEMPLATE = `Title:
  73. Thread: (link to thread on F95zone)
  74. Developer website:
  75. Version:
  76.  
  77. [CENTER][B][COLOR=#ff0000]Rules - Remove this before posting.[/COLOR][/B][/CENTER]
  78. *Any Online only or Multiplayer requests will be denied and deleted.
  79. *Don't ask for games that haven't been released yet.
  80. *Don't request more than 1 game per request (this includes siterip).
  81. *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.`;
  82. //Apply custom styles in a style tag
  83. function applyCSS(css) {
  84. let styleEl = document.querySelector("style");
  85. if (styleEl === null) {
  86. styleEl = document.createElement('style');
  87. }
  88. styleEl.appendChild(document.createTextNode(css));
  89. document.head.appendChild(styleEl);
  90. }
  91. function addButton(){
  92. let toolbarEl = document.querySelector('.fr-toolbar');
  93. toolbarEl.insertAdjacentHTML('beforeend','<div class="fr-separator fr-vs" role="separator" aria-orientation="vertical"></div>' +
  94. '<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' +
  95. ' id="xfTemp-1" role="button" tabindex="-1"\n' +
  96. ' type="button" title="Templates">\n' +
  97. ' <i aria-hidden="true" class="fas fa-file-word"></i>\n' +
  98. ' <span class="fr-sr-only">Templates</span>\n' +
  99. '</button>\n' +
  100. '<div aria-hidden="true" aria-labelledby="xfTemp-1" class="fr-dropdown-menu" id="dropdown-menu-xfTemp-1" role="listbox">\n' +
  101. ' <div class="fr-dropdown-wrapper" role="presentation">\n' +
  102. ' <div class="fr-dropdown-content" role="presentation">\n' +
  103. ' <ul class="fr-dropdown-list" role="presentation">\n' +
  104. ' <li role="presentation"><a class="fr-command" data-cmd="xfTemp" data-param1="xfTempNew" role="option"\n' +
  105. ' tabindex="-1" title="New Game Template">New Game Template</a></li>\n' +
  106. ' <li role="presentation"><a class="fr-command" data-cmd="xfTemp" data-param1="xfTempReq" role="option"\n' +
  107. ' tabindex="-1" title="Request Game Template">Request Game Template</a></li>\n' +
  108. ' <li role="presentation"><a class="fr-command" data-cmd="xfTemp" data-param1="xfTempUpdate" role="option"\n' +
  109. ' tabindex="-1" title="Update Game Template">Update Game Template</a></li>\n' +
  110. ' </ul>\n' +
  111. ' </div>\n' +
  112. ' </div>\n' +
  113. '</div>' +
  114. '<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>');
  115. }
  116. function refreshTextArea(){
  117. let textAreaEl = document.querySelector(".fr-element") //Text Area Element
  118. textAreaEl.replaceChildren();//Text Area Element
  119. let preEl = document.createElement("pre");
  120. textAreaEl.append(preEl); //Text Area Element
  121. }
  122.  
  123. function displayTextClick(e,template){
  124. refreshTextArea();
  125. let txt = document.createTextNode(template);
  126. document.querySelector(".fr-element").firstElementChild.append(txt); //Text Area Element
  127. document.querySelector('#xfTemp-1').classList.remove('fr-active','fr-selected');
  128. e.target.classList.remove('fr-selected');
  129. }
  130. function goToTagListClick(e){
  131. window.open("https://f95zone.to/threads/tags-rules-and-list-updated-2024-01-29.10394");
  132. }
  133.  
  134. function run(){
  135. applyCSS(styleCSS);
  136. addButton();
  137. document.querySelector('[title=\"New Game Template\"]').addEventListener('click',(e) => displayTextClick(e,NEW_TEMPLATE));
  138. document.querySelector('[title=\"Request Game Template\"]').addEventListener('click',(e) => displayTextClick(e,REQ_TEMPLATE));
  139. document.querySelector('[title=\"Update Game Template\"]').addEventListener('click',(e) => displayTextClick(e,UPDATE_TEMPLATE));
  140. document.querySelector('#xfTagList-1').addEventListener('click',(e) => goToTagListClick(e));
  141. }
  142. setTimeout(run,2500);
  143. })();