pm_helpLayer.py 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. # THIS FILE IS A PART OF VCStudio
  2. # PYTHON 3
  3. import os
  4. # GTK module ( Graphical interface
  5. import gi
  6. gi.require_version('Gtk', '3.0')
  7. from gi.repository import Gtk
  8. from gi.repository import GLib
  9. from gi.repository import Gdk
  10. import cairo
  11. # Own modules
  12. from settings import settings
  13. from settings import talk
  14. from project_manager import pm_project
  15. #UI modules
  16. from UI import UI_elements
  17. from UI import UI_color
  18. def layer(win):
  19. # Making the layer
  20. surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, win.current['w'],
  21. win.current['h'])
  22. layer = cairo.Context(surface)
  23. #text setting
  24. layer.select_font_face("Monospace", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL)
  25. UI_color.set(layer, win, "dark_overdrop")
  26. layer.rectangle(
  27. 0,
  28. 0,
  29. win.current["w"],
  30. win.current["h"],
  31. )
  32. layer.fill()
  33. # So it's going to be like a little window in the center of the VCStudio
  34. # with a simple UI. Probably like 2 things. Folder and a projectname.
  35. UI_color.set(layer, win, "node_background")
  36. UI_elements.roundrect(layer, win,
  37. 100,
  38. 100,
  39. win.current["w"]-200,
  40. win.current["h"]-200,
  41. 10)
  42. # Exit button
  43. def do():
  44. win.url = "project_manager"
  45. win.textactive = ""
  46. UI_elements.roundrect(layer, win,
  47. win.current["w"]-140,
  48. win.current["h"]-140,
  49. 40,
  50. 40,
  51. 10,
  52. button=do,
  53. icon="cancel",
  54. tip=talk.text("cancel"))
  55. # Clipping everything
  56. UI_elements.roundrect(layer, win,
  57. 100,
  58. 110,
  59. win.current["w"]-200,
  60. win.current["h"]-260,
  61. 10,
  62. fill=False)
  63. layer.clip()
  64. # Setting up the scroll
  65. if "pm_help" not in win.scroll:
  66. win.scroll["pm_help"] = 0
  67. current_Y = 1 # The max scroll value
  68. # VCStudio icon.
  69. UI_elements.image(layer, win, "tinyicon.png", win.current["w"]/2-205,
  70. current_Y+win.scroll["pm_help"]+120 )
  71. UI_color.set(layer, win, "text_normal")
  72. layer.move_to(win.current["w"]/2-205+148, current_Y+win.scroll["pm_help"]+200)
  73. layer.set_font_size(50)
  74. layer.show_text("VCStudio")
  75. # Version
  76. layer.move_to(win.current["w"]/2-205+148, current_Y+win.scroll["pm_help"]+230)
  77. layer.set_font_size(20)
  78. layer.show_text(str(win.version))
  79. current_Y = current_Y+200
  80. # Here I want to put my own credit. And credits of anybody else who will
  81. # maybe help in future. For now my own credit.
  82. UI_elements.image(layer, win, "project_manager/help_images/Blender_Dumbass_Avatar.png", 140,
  83. current_Y+win.scroll["pm_help"]+120 )
  84. UI_color.set(layer, win, "text_normal")
  85. layer.move_to(280, current_Y+win.scroll["pm_help"]+150)
  86. layer.set_font_size(20)
  87. layer.show_text(talk.text("Developer")+":")
  88. layer.move_to(300, current_Y+win.scroll["pm_help"]+190)
  89. layer.set_font_size(30)
  90. layer.show_text("J.Y.Amihud")
  91. layer.move_to(280, current_Y+win.scroll["pm_help"]+230)
  92. layer.set_font_size(25)
  93. layer.show_text("(Blender Dumbass)")
  94. # Links to my accounts
  95. # Originally I wanted YouTube to be on the list as well. As you may know
  96. # I have a little YouTube channel called "Blender Dumbass". But I dislike
  97. # Youtube. And I don't want to promote it.
  98. # I'm concidering to remove Patreon and Twitter as well. Let me thing about
  99. # it.
  100. links = {
  101. "NotABug":"https://notabug.org/troler/foo",
  102. "Devtalk":"https://devtalk.blender.org/u/blenderdumbass",
  103. #"GitHub":"https://github.com/JYamihud",
  104. "Telegram":"https://t.me/blenderorganizer",
  105. #"Telegram 2":"https://t.me/blenderdumbasschat",
  106. #"Telegram 3":"https://t.me/moriasrace",
  107. #"Patreon":"https://www.patreon.com/blenderdumbass",
  108. #"Twitter":"https://twitter.com/blenderdumbass",
  109. "Bl-chat":"https://blender.chat/channel/blenderorganizer_vcstudio",
  110. "LBRY":"https://open.lbry.com/@blender-organizer:5?r=2caeB3mkHkXkQXAjxGXoKNPifSv91N58",
  111. "Music":"https://open.lbry.com/@J.Y.AmihudMusic:c?r=GLhXoQ3zcpvm6rzd9Z6dAyasTpmk1FUY",
  112. #"Movies":"https://open.lbry.com/@VCS:7?r=GLhXoQ3zcpvm6rzd9Z6dAyasTpmk1FUY"
  113. }
  114. tileY = 50
  115. tileX = 0
  116. for link in links:
  117. if tileY < 130:
  118. posX = 450 + 100
  119. else:
  120. posX = 128
  121. def do():
  122. os.system("xdg-open "+links[link])
  123. UI_elements.roundrect(layer, win,
  124. tileX+posX,
  125. current_Y+100+tileY+win.scroll["pm_help"],
  126. 170,
  127. 40,
  128. 10,
  129. button=do,
  130. icon="internet",
  131. tip=links[link],
  132. clip=[
  133. 100,
  134. 110,
  135. win.current["w"]-200,
  136. win.current["h"]-260,
  137. ])
  138. UI_color.set(layer, win, "text_normal")
  139. layer.move_to(tileX+posX+50, current_Y+win.scroll["pm_help"]+100+tileY+30)
  140. layer.set_font_size(20)
  141. layer.show_text(link)
  142. tileX += 170
  143. if tileX+posX > win.current["w"]-300:
  144. tileX = 0
  145. tileY += 50
  146. if tileY > 130:
  147. current_Y += tileY
  148. else:
  149. current_Y += 130
  150. current_Y = current_Y+200
  151. # Secondary credits / thanks. Unrelated to this project.
  152. UI_color.set(layer, win, "text_normal")
  153. layer.move_to(120, current_Y+win.scroll["pm_help"])
  154. layer.set_font_size(20)
  155. layer.show_text(talk.text("help_indirect_credits"))
  156. current_Y += 30
  157. credits = {
  158. "Richard Stallman":[
  159. "project_manager/help_images/stallman.png",
  160. "https://www.gnu.org/",
  161. talk.text("help_stallman")
  162. ],
  163. "Linus Torvalds":[
  164. "project_manager/help_images/torvalds.png",
  165. "https://www.linuxfoundation.org/",
  166. talk.text("help_torvalds")
  167. ],
  168. "Ton Roosendaal":[
  169. "project_manager/help_images/roosendaal.png",
  170. "https://www.blender.org/",
  171. talk.text("help_roosendaal")
  172. ]
  173. }
  174. tileX = 150
  175. for credit in credits:
  176. UI_elements.image(layer, win, credits[credit][0], tileX,
  177. current_Y+win.scroll["pm_help"] )
  178. UI_color.set(layer, win, "text_normal")
  179. layer.move_to(tileX, current_Y+win.scroll["pm_help"]+150)
  180. layer.set_font_size(15)
  181. layer.show_text(credit)
  182. def do():
  183. os.system("xdg-open "+credits[credit][1])
  184. UI_elements.roundrect(layer, win,
  185. tileX-20,
  186. current_Y+win.scroll["pm_help"]-10,
  187. 170,
  188. 200,
  189. 10,
  190. button=do,
  191. fill=False,
  192. tip=credits[credit][2],
  193. clip=[
  194. 100,
  195. 110,
  196. win.current["w"]-200,
  197. win.current["h"]-260,
  198. ])
  199. layer.stroke()
  200. tileX += 250
  201. if tileX > win.current["w"]-300:
  202. current_Y += 250
  203. tileX = 150
  204. current_Y += 250
  205. # Movies
  206. movies = {
  207. "I'm Not Even Human":[
  208. "2018/05/01",
  209. "Blender-Organizer 1.0 - 3.9",
  210. "https://open.lbry.com/@VCS:7/Imnotevenhumanshortfilm:3?r=GLhXoQ3zcpvm6rzd9Z6dAyasTpmk1FUY",
  211. "project_manager/help_images/Im_Not_Even_Human_Poster.png"
  212. ],
  213. "The Package, The Car & The Time Is Running Out":[
  214. "2018/11/06",
  215. "Blender-Organizer 4.0 - 4.17",
  216. "https://open.lbry.com/@VCS:7/ThePackageTheCarAndTheTimeIsRunningOut:3?r=GLhXoQ3zcpvm6rzd9Z6dAyasTpmk1FUY",
  217. "project_manager/help_images/The_Package_The_Car_And_Time_Is_Running_Out_Poster.png"
  218. ],
  219. "Moria's Race":[
  220. talk.text("In_Production"),
  221. "Blender-Organizer 4.18 - VCStudio "+str(win.version),
  222. "https://t.me/moriasrace",
  223. "project_manager/help_images/Morias_Race_Poster.png"
  224. ]
  225. }
  226. UI_color.set(layer, win, "text_normal")
  227. layer.move_to(120, current_Y+win.scroll["pm_help"])
  228. layer.set_font_size(20)
  229. layer.show_text(talk.text("help_movies_done_title"))
  230. current_Y = current_Y+20
  231. tileX = 120
  232. for movie in movies:
  233. UI_elements.image(layer, win, movies[movie][3], tileX,
  234. current_Y+win.scroll["pm_help"] , height=300, width=226)
  235. def do():
  236. os.system("xdg-open "+movies[movie][2])
  237. UI_elements.roundrect(layer, win,
  238. tileX,
  239. current_Y+win.scroll["pm_help"],
  240. 226,
  241. 300,
  242. 10,
  243. button=do,
  244. fill=False,
  245. tip=movie+"\n"+movies[movie][0]+"\n"+movies[movie][1],
  246. clip=[
  247. 100,
  248. 110,
  249. win.current["w"]-200,
  250. win.current["h"]-260,
  251. ])
  252. layer.stroke()
  253. tileX += 300
  254. if tileX > win.current["w"]-300:
  255. tileX = 120
  256. current_Y = current_Y+350
  257. current_Y = current_Y+400
  258. # Wiki
  259. # Tutorials about VCStudio.
  260. UI_color.set(layer, win, "text_normal")
  261. layer.move_to(120, current_Y+win.scroll["pm_help"])
  262. layer.set_font_size(20)
  263. layer.show_text(talk.text("help_read_wiki"))
  264. current_Y = current_Y+20
  265. tutorials = [
  266. ["Documenation | Installation | Version 20.128", "https://notabug.org/jyamihud/VCStudio/wiki/Documenation+%7C+Installation+%7C+Version+20.128"],
  267. ["Documenation | Project Manager | Version 20.128", "https://notabug.org/jyamihud/VCStudio/wiki/Documenation+%7C+Project+Manager+%7C+Version+20.128"],
  268. ["Documenation | Story Editor | Version 20.128", "https://notabug.org/jyamihud/VCStudio/wiki/Documenation+%7C+Story+Editor+%7C+Version+20.128+"],
  269. ["Documenation | Script Writer | Version 20.128", "https://notabug.org/jyamihud/VCStudio/wiki/Documenation+%7C+Script+Writer+%7C+Version+20.128"],
  270. ["Documenation | Analytics | Version 20.128", "https://notabug.org/jyamihud/VCStudio/wiki/Documenation+%7C+Analytics+%7C+Version+20.128"],
  271. ["Documenation | Assets | Version 20.128", "https://notabug.org/jyamihud/VCStudio/wiki/Documenation+%7C+Assets+%7C+Version+20.128"],
  272. ["Documenation | Linking Assets | Version 20.128", "https://notabug.org/jyamihud/VCStudio/wiki/Documenation+%7C+Linking+Assets+%7C+Version+20.128"],
  273. ["Documenation | Rendering | Version 20.128", "https://notabug.org/jyamihud/VCStudio/wiki/Documenation+%7C+Rendering+%7C+Version+20.128"]
  274. ]
  275. for tutorial in tutorials:
  276. def do():
  277. os.system("xdg-open "+tutorial[1])
  278. UI_elements.roundrect(layer, win,
  279. 110,
  280. current_Y+win.scroll["pm_help"],
  281. win.current["w"]-250,
  282. 40,
  283. 10,
  284. button=do,
  285. icon="scene",
  286. tip=tutorial[1],
  287. clip=[
  288. 100,
  289. 110,
  290. win.current["w"]-200,
  291. win.current["h"]-260,
  292. ])
  293. UI_color.set(layer, win, "text_normal")
  294. layer.move_to(160, current_Y+win.scroll["pm_help"]+25)
  295. layer.set_font_size(20)
  296. layer.show_text(tutorial[0])
  297. current_Y = current_Y+50
  298. current_Y += 60
  299. # Tutorials about VCStudio.
  300. UI_color.set(layer, win, "text_normal")
  301. layer.move_to(120, current_Y+win.scroll["pm_help"])
  302. layer.set_font_size(20)
  303. layer.show_text(talk.text("help_tutorial_title"))
  304. current_Y = current_Y+20
  305. tutorials = [
  306. [talk.text("tutorial_legacy_analitycs"), "https://open.lbry.com/@blender-organizer:5/BlenderOrganizerAnalyticsTutorial4.87:6?r=GLhXoQ3zcpvm6rzd9Z6dAyasTpmk1FUY"],
  307. [talk.text("tutorial_legacy_storyeditor"), "https://open.lbry.com/@blender-organizer:5/BlenderOrganizerStoryEditorTutorialv4.87:0?r=GLhXoQ3zcpvm6rzd9Z6dAyasTpmk1FUY"],
  308. [talk.text("tutorial_legacy_assets"), "https://open.lbry.com/@blender-organizer:5/BlenderOrganizerAssetsTutorialv4.87:e?r=GLhXoQ3zcpvm6rzd9Z6dAyasTpmk1FUY"]
  309. ]
  310. for tutorial in tutorials:
  311. def do():
  312. os.system("xdg-open "+tutorial[1])
  313. UI_elements.roundrect(layer, win,
  314. 110,
  315. current_Y+win.scroll["pm_help"],
  316. win.current["w"]-250,
  317. 40,
  318. 10,
  319. button=do,
  320. icon="video",
  321. tip=talk.text("ClickToWatch"),
  322. clip=[
  323. 100,
  324. 110,
  325. win.current["w"]-200,
  326. win.current["h"]-260,
  327. ])
  328. UI_color.set(layer, win, "text_normal")
  329. layer.move_to(160, current_Y+win.scroll["pm_help"]+25)
  330. layer.set_font_size(20)
  331. layer.show_text(tutorial[0])
  332. current_Y = current_Y+50
  333. current_Y = current_Y+138
  334. current_Y = current_Y+138
  335. UI_elements.scroll_area(layer, win, "pm_help",
  336. 100,
  337. 100,
  338. win.current["w"] - 200,
  339. win.current["h"] - 250,
  340. current_Y,
  341. bar=True,
  342. mmb=True,
  343. url="help_layer"
  344. )
  345. return surface