1
0

newspaper.qsrc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # newspaper
  2. !!=======================================================!!
  3. !! !!
  4. !! CIKL !!
  5. !! !!
  6. !!=======================================================!!
  7. if $ARGS[0] = 'cikl':
  8. mc_inventory['newspaper'] = 0
  9. gs 'newspaper_pages', 'init'
  10. idx = rand(0, arrsize('np_front_pages') - 1)
  11. $newspaperVars['page_0'] = $np_front_pages[idx]
  12. killvar 'np_front_pages'
  13. i = 1
  14. :newspaper_shuffle_loop
  15. idx = rand(0, arrsize('$np_pages') - 1)
  16. $newspaperVars['page_<<i>>'] = $np_pages[idx]
  17. i += 1
  18. killvar '$np_pages', idx
  19. if arrsize('$np_pages') > 0: jump 'newspaper_shuffle_loop'
  20. newspaperVars['max_page_num'] = i - 1
  21. killvar 'i'
  22. killvar '$np_pages'
  23. end
  24. !!=======================================================!!
  25. !! !!
  26. !! VIEW !!
  27. !! !!
  28. !!=======================================================!!
  29. if $ARGS[0] = 'start':
  30. temp_np_page = 0
  31. gs 'newspaper', 'view'
  32. end
  33. if $ARGS[0] = 'view':
  34. *clr & cla
  35. '<center><h2>Delovoy Petersburg</h2></center>'
  36. act 'Put the newspaper away':
  37. killvar 'temp_np_page'
  38. if newspaperVars['dbag'] = 0:
  39. gt $menu_loc, $menu_arg
  40. else
  41. gs 'din_bad', 'd_bag'
  42. end
  43. end
  44. if temp_np_page < newspaperVars['max_page_num']:
  45. act 'Flip to the next article':
  46. temp_np_page += 1
  47. gs 'newspaper', 'view'
  48. end
  49. end
  50. if temp_np_page > 0:
  51. act 'Flip to the previous article':
  52. temp_np_page -= 1
  53. gs 'newspaper', 'view'
  54. end
  55. end
  56. dynamic $newspaperVars['page_<<temp_np_page>>']
  57. end
  58. --- newspaper ---------------------------------