1
0

mod_setting.qsrc 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. # mod_setting
  2. !'Mod system 1.0 by illume'
  3. gs 'obj_din', 'settingtabs'
  4. cla
  5. if settingmode = 1:
  6. !value= 2, call from Character creation
  7. act '<center><b>Return to character creation</b></center>': killvar 'menu_page' & gt 'begin', 'start'
  8. else
  9. !call from Menu - Game settings
  10. act 'Exit the menu': gs 'obj_din', 'menu_exit' & gt $menu_loc, $menu_arg
  11. end
  12. *nl '<center><h1>MODs</h1></center>'
  13. '<center>'
  14. '<b>WARNING</b>: Game slowdown may occur when installing too many mods, or mods with bad structure.'
  15. *nl
  16. 'You may find information on available Mods as well as instructions on installing Mods on this thread:'
  17. '<a href="https://tfgames.site/phpbb3/viewtopic.php?f=70&t=11793&sid=08ee13168a1ea71fa2348f20815b8380">https://tfgames.site/phpbb3/viewtopic.php?f=70&t=11793&sid=08ee13168a1ea71fa2348f20815b8380</a>'
  18. *nl
  19. if mod_list > 0:
  20. '<table border=1><tr><td>id</td><td>Name</td><td>Version</td><td>Author</td><td>Description</td><td>Options</td></tr>'
  21. mod_i=1
  22. :mod_alllist
  23. if $mod_name[mod_i] ! '':
  24. !name
  25. *p '<tr><td><<mod_i>></td><td><<$mod_name[mod_i]>></td>'
  26. !version
  27. *p '<td><<val($mod_version[mod_i])/10000>>.<<(val($mod_version[mod_i]) mod 10000)/100>> <<iif(val($mod_version[mod_i]) mod 100 > 0, ''fix <<val($mod_version[mod_i]) mod 100>> '', '' '')>></td>'
  28. !author
  29. *p '<td><<$mod_author[mod_i]>></td>'
  30. !description and readme
  31. *p '<td><a href="exec:gs ''mod_<<$mod_name[mod_i]>>_readme''"><img src="images/system/icons/anptekainfo.jpg"></a> <<$mod_desc[mod_i]>></td>'
  32. !mod options page
  33. *p '<td>'+iif($mod_opt[mod_i] ! '','<a href="exec:gs ''mod_<<$mod_name[mod_i]>>_options''"><<$mod_opt[mod_i]>></a>','')+'</td></tr>'
  34. else
  35. 'ERROR loading mod id <<mod_i>>, no mod name available'
  36. end
  37. if mod_list > mod_i:
  38. mod_i+=1
  39. jump 'mod_alllist'
  40. end
  41. killvar '$mod_info'
  42. '</table>'
  43. else
  44. '<br>You have no Mods activated.'
  45. end
  46. '</center>'
  47. act ''+iif(settingmode = 1, '<center><b>Install new mod</b></center>','Install new mod')+'':
  48. killvar '$mod_info'
  49. $mod_temp=input('input mod name (as for the example image above, input <B>isample</B>)')
  50. if $mod_temp='':exit
  51. addqst 'mod/<<$mod_temp>>.qsp'
  52. gs 'mod_<<$mod_temp>>_setup'
  53. if $mod_info[0] = '':
  54. msg '<b><<$mod_temp>>.qsp</b> is not a Girl life ECV mod, please contract its author for help'
  55. exit
  56. end
  57. mod_list += 1
  58. $mod_name[mod_list] = $mod_info[0]
  59. $mod_version[mod_list] = $mod_info[1]
  60. $mod_author[mod_list] = $mod_info[2]
  61. $mod_desc[mod_list] = $mod_info[3]
  62. $mod_opt[mod_list] = $mod_info[4]
  63. gt 'mod_setting'
  64. end
  65. if mod_list > 0:
  66. act ''+iif(settingmode = 1, '<center><b>Disable all mods</b></center>','Disable all mods')+'':
  67. if input('Are you sure? ALL mod will be disabled!<br>please input <b>qqq</B> to confirm') = 'qqq':
  68. if mod_list > 0:
  69. mod_i=mod_list
  70. :mod_data_remover
  71. if $mod_name[mod_i] ! '':
  72. $mod_su_name = 'mod_<<$mod_name[mod_i]>>_onremove'
  73. if LOC($mod_su_name): gs $mod_su_name
  74. end
  75. if mod_i > 0:
  76. mod_i-=1
  77. jump 'mod_data_remover'
  78. end
  79. killvar '$mod_su_name'
  80. killvar 'mod_i'
  81. end
  82. killqst
  83. set mod_list=0
  84. killvar '$mod_name'
  85. killvar '$mod_version'
  86. killvar '$mod_author'
  87. killvar '$mod_desc'
  88. killvar '$mod_opt'
  89. msg 'All mod disabled. You can re-install them later.'
  90. gt 'mod_setting'
  91. end
  92. end
  93. ! Delete single mod
  94. act ''+iif(settingmode = 1, '<center><b>Uninstall mod</b></center>','Uninstall mod')+'':
  95. $mod_temp = input('Input mod name to uninstall (Case Sensetive)')
  96. mod_removed_temp = 0
  97. if $mod_temp ! '':
  98. mod_i = mod_list
  99. :mod_data_remover
  100. if $mod_name[mod_i] = $mod_temp:
  101. $mod_su_name = 'mod_<<$mod_name[mod_i]>>_onremove'
  102. if LOC($mod_su_name): gs $mod_su_name
  103. mod_removed_temp += 1
  104. $mod_name_temp[mod_i] = ''
  105. else
  106. $mod_name_temp[mod_i] = $mod_name[mod_i]
  107. $mod_version_temp[mod_i] = $mod_version[mod_i]
  108. $mod_author_temp[mod_i] = $mod_author[mod_i]
  109. $mod_desc_temp[mod_i] = $mod_desc[mod_i]
  110. $mod_opt_temp[mod_i] = $mod_opt[mod_i]
  111. end
  112. if mod_i > 1:
  113. mod_i -= 1
  114. jump 'mod_data_remover'
  115. end
  116. killvar '$mod_su_name'
  117. killvar 'mod_i'
  118. end
  119. if mod_removed_temp > 0:
  120. killqst
  121. killvar '$mod_name'
  122. killvar '$mod_version'
  123. killvar '$mod_author'
  124. killvar '$mod_desc'
  125. killvar '$mod_opt'
  126. mod_i = 1
  127. mod_restored_i = 1
  128. :mod_data_restore
  129. if $mod_name_temp[mod_i] ! '':
  130. $mod_name_add_temp = $mod_name_temp[mod_i]
  131. addqst 'mod/<<$mod_name_add_temp>>.qsp'
  132. killvar '$mod_name_add_temp'
  133. $mod_name[mod_restored_i] = $mod_name_temp[mod_i]
  134. $mod_version[mod_restored_i] = $mod_version_temp[mod_i]
  135. $mod_author[mod_restored_i] = $mod_author_temp[mod_i]
  136. $mod_desc[mod_restored_i] = $mod_desc_temp[mod_i]
  137. $mod_opt[mod_restored_i] = $mod_opt_temp[mod_i]
  138. mod_restored_i += 1
  139. end
  140. if mod_i < mod_list:
  141. mod_i += 1
  142. jump 'mod_data_restore'
  143. end
  144. mod_list = mod_restored_i - 1
  145. killvar '$mod_name_temp'
  146. killvar '$mod_version_temp'
  147. killvar '$mod_author_temp'
  148. killvar '$mod_desc_temp'
  149. killvar '$mod_opt_temp'
  150. killvar 'mod_i'
  151. killvar 'mod_restored_i'
  152. if mod_removed_temp > 0:
  153. msg 'Mod <<$mod_temp>> was disabled.'
  154. end
  155. else
  156. msg 'Mod <<$mod_temp>> was not installed.'
  157. end
  158. killvar 'mod_removed_temp'
  159. killvar 'mod_temp'
  160. gt 'mod_setting'
  161. end
  162. end
  163. --- mod_setting ---------------------------------