Guest User

Untitled

a guest
Sep 19th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.48 KB | None | 0 0
  1.  
  2.            
  3. case 2:
  4.     //  Always comes here to check if it has Character Waiting.
  5.     if(tr->dialogue->chr_wait)
  6.     {
  7.         //  If so, write nothing, and move to the following state.
  8.         //  To process the text character by character.
  9.         tr->state = 3;
  10.     }
  11.     else
  12.     {
  13.         //  If there is no Character Waiting on this Dialogue
  14.         //  piece, just print the text on the box.
  15.         tte_write(tr->chr);
  16.         tr->state = 99;
  17.     }
  18.  
  19. case 3:
  20.     //  Adds the Character counter.
  21.     tr->wait_counter++;
  22.    
  23.     //  If the waiting is = to the dialogue's assigned Character
  24.     //  Waiting...
  25.     if(tr->wait_counter == tr->dialogue->chr_wait)
  26.     {
  27.         //  Get the remaining "unprinted" string from the
  28.         //  Dialogue Structure (tr = Text Render).
  29.         text = tr->chr;
  30.        
  31.         //  Check for a TTE command ignoring the second
  32.         //  character ('{') confirmation.
  33.         if((*text) == '#')
  34.         {
  35.             //  If so, move forward 2 chars on the string,
  36.             text += 2;
  37.             //  and input the command line beyond the '{' char,
  38.             //  getting the returned continuation of the string
  39.             text = tte_cmd_default(text+2);
  40.         }
  41.        
  42.         //  Input the present char on the remaining string,
  43.         tte_putc((*text));
  44.         //  and move a char forward on he string
  45.         text++;
  46.        
  47.         //  Reset the Character Counter to 0
  48.         tr->wait_counter = 0;
  49.        
  50.         //  Check if it is the end of the dialogue piece,
  51.         //  to proceed into the box interaction.
  52.         if((*text) == '\0')
  53.             tr->state = 99;
  54.        
  55.         //  Return the remaining string to the
  56.         //  Dialogue Structure.
  57.         tr->chr = text;
  58.     }
  59. break;
Add Comment
Please, Sign In to add comment