Advertisement
ZoriaRPG

CustomTango,.zh

Feb 18th, 2017
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.66 KB | None | 0 0
  1. // tango.zh
  2. // Version 1.0.0
  3.  
  4. // Import Fonts
  5.  
  6. import "tango/font/Allegro.zh"
  7. import "tango/font/GUI.zh"
  8. import "tango/font/GUIBold.zh"
  9. import "tango/font/LA.zh"
  10. import "tango/font/LttP.zh"
  11. import "tango/font/LttPSmall.zh"
  12. import "tango/font/Matrix.zh"
  13. import "tango/font/NES.zh"
  14. import "tango/font/Oracle.zh"
  15. import "tango/font/OracleProportional.zh"
  16. import "tango/font/Phantom.zh"
  17. import "tango/font/PhantomProportional.zh"
  18. import "tango/font/Small.zh"
  19. import "tango/font/Small2.zh"
  20. import "tango/font/SmallProportional.zh"
  21. import "tango/font/SS3.zh"
  22.  
  23. // Standard settings -----------------------------------------------------------
  24.  
  25. // Screen Freezing
  26.  
  27. const int FFC_FREEZE_1 = 31;
  28. const int FFC_FREEZE_2 = 32;
  29. const int SCREEN_FREEZE_COMBO_1 = 2252;
  30. const int SCREEN_FREEZE_COMBO_2 = 2252;
  31. const int MENU_FREEZE_ALL = 2252;
  32.  
  33.  
  34. // How fast messages scroll
  35. const int __TANGO_SCROLL_SPEED = 4;
  36.  
  37. // How much holding A speeds up text
  38. const int __TANGO_SPEEDUP_FACTOR = 5;
  39.  
  40. // Whether holding A or B speeds up scrolling to the next message
  41. const int __TANGO_SCROLL_SPEEDUP = 1;
  42.  
  43. // Whether a sound is played when a space is printed
  44. const int __TANGO_SFX_ON_SPACE = 0;
  45.  
  46. // Whether there's a delay before a space, as with printable characters
  47. const int __TANGO_DELAY_ON_SPACE = 1;
  48.  
  49. // Strings that advance automatically will wait this long before doing so
  50. const int __TANGO_AUTO_ADVANCE_TIME = 90;
  51.  
  52. // Layer to draw on
  53. const int __TANGO_DRAWING_LAYER = 6;
  54.  
  55. // Offscreen bitmap to use for text rendering
  56. const int __TANGO_BITMAP = 6;
  57.  
  58. // String codes are marked by this character
  59. // 64 is @
  60. const int __TANGO_CODE_DELIMITER = 64;
  61.  
  62. // Whether the current string scrolls up before displaying the next one
  63. // rather than just disappearing
  64. const int __TANGO_SCROLL_TO_NEXT = 1;
  65.  
  66. // The maximum length of a string handled by @string.
  67. // Increasing this will make the function take more space in the buffer.
  68. // It's not necessary to account for the null terminator.
  69. const int __TANGO_MAX_STRING_FUNC_LENGTH = 16;
  70.  
  71. // End standard settings -------------------------------------------------------
  72.  
  73.  
  74.  
  75. // Advanced settings -----------------------------------------------------------
  76.  
  77. // Custom variables
  78. float Tango_D[8]; // Access as @d0 to @d8; can be safely removed
  79.  
  80. const float VAR_TANGO_D0 =  0.0055;
  81. const float VAR_TANGO_D7 =  0.0062;
  82.  
  83. float Tango_GetCustomVar(int var)
  84. {
  85.     if(var>=VAR_TANGO_D0 && var<=VAR_TANGO_D7)
  86.         return Tango_D[(var-VAR_TANGO_D0)*10000];
  87.     else
  88.     {
  89.         Tango_LogUndefinedVariable(var);
  90.         return 0;
  91.     }
  92. }
  93.  
  94. void Tango_SetCustomVar(int var, float value)
  95. {
  96.     if(var>=VAR_TANGO_D0 && var<=VAR_TANGO_D7)
  97.         Tango_D[(var-VAR_TANGO_D0)*10000]=value;
  98.     else
  99.         Tango_LogUndefinedVariable(var);
  100. }
  101.  
  102. // Custom functions
  103.  
  104. float __Tango_RunCustomFunction(float function, float args)
  105. {
  106.     Tango_LogUndefinedFunction(function);
  107.     return 0;
  108. }
  109.  
  110. // Menu data
  111. const int __TANGO_MAX_MENU_ITEMS = 40;
  112. float __Tango_Data[960]; // 24+3*__TANGO_MAX_MENU_ITEMS
  113.  
  114. // Style data
  115. const int __TANGO_NUM_STYLES = 6;
  116. int __Tango_Styles[156]; // 26 * __TANGO_NUM_STYLES
  117.  
  118. // Text buffer and slots
  119. int __Tango_Buffer[4096]; // Arbitrary size
  120.  
  121. const int __TANGO_NUM_SLOTS = 6;
  122. int __Tango_SlotData[240]; // 20 * __TANGO_NUM_SLOTS
  123.  
  124. // Slot types and definitions
  125. const int TANGO_SLOT_NORMAL = 0;
  126.  
  127. // Slot types and definitions
  128. const int TANGO_SLOT_WINDOW = 0;
  129.  
  130. int __Tango_SlotDefs[] = {
  131.     // 0
  132.  
  133.    
  134.     TANGO_SLOT_WINDOW,
  135.     0,        // Starting index in __Tango_StringBuffer
  136.     256,      // Maximum length after processing
  137.     0, 0,     // X, Y on offscreen bitmap
  138.     256, 176, // Width, height on offscreen bitmap
  139.    
  140.     // 1
  141.     TANGO_SLOT_WINDOW,
  142.     256,
  143.     256,
  144.     256, 0,
  145.     256, 176,
  146.    
  147.     //2
  148.     TANGO_SLOT_WINDOW,
  149.     512,
  150.     256,
  151.     0, 176,
  152.     256, 176,
  153.    
  154.     //3
  155.     TANGO_SLOT_WINDOW,
  156.     768,
  157.     256,
  158.     256, 176,
  159.     176, 176,
  160.  
  161.     //4
  162.    TANGO_SLOT_WINDOW,
  163.     1024,
  164.     256,
  165.     0, 256,
  166.     256, 176,
  167.    
  168.    TANGO_SLOT_NORMAL,
  169.     0,        // Starting index in __Tango_StringBuffer
  170.     512,      // Maximum length after processing
  171.     0, 0,     // X, Y on offscreen bitmap
  172.     256, 512, // Width, height on offscreen bitmap
  173.    
  174.     // 1
  175.     TANGO_SLOT_NORMAL,
  176.     512,
  177.     512,
  178.     256, 0,
  179.     256, 512
  180.     };
  181.  
  182.  
  183. // These must be implemented in order for TANGO_FLAG_FREEZE_SCREEN to work.
  184. // These are used by TANGO_FLAG_FREEZE_SCREEN.
  185. void __Tango_FreezeScreen()
  186. {
  187. ffc freezer=Screen->LoadFFC(31);    
  188. freezer->Data=MENU_FREEZE_ALL;    //2252
  189. freezer=Screen->LoadFFC(FFC_FREEZE_2);    
  190. freezer->Data=0;    
  191. SuspendGhostZHScripts();
  192. }
  193.  
  194. void __Tango_UnfreezeScreen()
  195. {
  196. ffc freezer=Screen->LoadFFC(31);    
  197. freezer->Data=0;    
  198. freezer=Screen->LoadFFC(FFC_FREEZE_2);    
  199. freezer->Data=0;    
  200. ResumeGhostZHScripts();
  201. }
  202.  
  203. // Edit these functions to change which buttons are used.
  204.  
  205. // Return Link->Press* for advance/end string button
  206. bool __Tango_PressAdvance()
  207. {
  208.     return Link->PressA;
  209. }
  210.  
  211. // Return Link->Input* for advance/end string button
  212. bool __Tango_InputAdvance()
  213. {
  214.     return Link->InputA;
  215. }
  216.  
  217. // Unset Link->Input* and Link->Press* for advance/end string button
  218. void __Tango_UnpressAdvance()
  219. {
  220.     Link->InputA=false;
  221.     Link->PressA=false;
  222. }
  223.  
  224. // Return Link->Press* for speedup button
  225. bool __Tango_PressSpeedup()
  226. {
  227.     return Link->PressA;
  228. }
  229.  
  230. // Return Link->Input* for speedup button
  231. bool __Tango_InputSpeedup()
  232. {
  233.     return Link->InputA;
  234. }
  235.  
  236. // Unset Link->Input* and Link->Press* for speedup button
  237. void __Tango_UnpressSpeedup()
  238. {
  239.     Link->InputA=false;
  240.     Link->PressA=false;
  241. }
  242.  
  243. // Return Link->Press* for super speed button
  244. bool __Tango_PressSuperSpeed()
  245. {
  246.     return Link->PressB;
  247. }
  248.  
  249. // Return Link->Input* for super speed button
  250. bool __Tango_InputSuperSpeed()
  251. {
  252.     return Link->InputB;
  253. }
  254.  
  255. // Unset Link->Input* and Link->Press* for super speed button
  256. void __Tango_UnpressSuperSpeed()
  257. {
  258.     Link->InputB=false;
  259.     Link->PressB=false;
  260. }
  261.  
  262. // Return Link->Press* for menu select button
  263. bool __Tango_PressMenuSelect()
  264. {
  265.     return ( Link->PressA || Link->PressStart );
  266. }
  267.  
  268. // Return Link->Press* for menu cancel button
  269. bool __Tango_PressMenuCancel()
  270. {
  271.     return Link->PressB;
  272. }
  273.  
  274. // Return Link->Input* for both menu select and cancel buttons
  275. bool __Tango_InputMenu()
  276. {
  277.     return Link->InputA || Link->InputB;
  278. }
  279.  
  280. // Unset Link->Input* and Link->Press* for menu select and cancel buttons
  281. void __Tango_UnpressMenu()
  282. {
  283.     Link->InputA=false;
  284.     Link->PressA=false;
  285.     Link->InputB=false;
  286.     Link->PressB=false;
  287. }
  288.  
  289.  
  290. // Import stringControlCode.zh instead of stringControlCodeDisabled.zh
  291. // to enable string control codes.
  292. import "tango/1.0/stringControlCodeDisabled.zh"
  293. //import "tango/1.0/stringControlCode.zh"
  294.  
  295.  
  296. // Import loggingFull.zh instead of loggingMinimal.zh for more useful
  297. // error messages. This will bloat scripts, so it should only be used
  298. // for debugging.
  299. import "tango/1.0/loggingIntermediate.zh" //This is a custom file, not part of the ordinary Tango package.
  300. //import "tango/1.0/loggingMinimal.zh"
  301. //import "tango/1.0/loggingFull.zh"
  302.  
  303. // End advanced settings -------------------------------------------------------
  304.  
  305.  
  306. import "tango/1.0/access.zh"
  307. import "tango/1.0/common.zh"
  308. import "tango/1.0/drawing.zh"
  309. import "tango/1.0/font.zh"
  310. import "tango/1.0/functions.zh"
  311. import "tango/1.0/loading.zh"
  312. import "tango/1.0/menu.zh"
  313. import "tango/1.0/messages.zh"
  314. import "tango/1.0/metrics.zh"
  315. import "tango/1.0/processing.zh"
  316. import "tango/1.0/style.zh"
  317. import "tango/1.0/user.zh"
  318. import "tango/1.0/validation.zh"
  319.  
  320. import "tango/1.0/script.z"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement