Advertisement
Guest User

E+C Item Highlight

a guest
May 10th, 2017
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.28 KB | None | 0 0
  1. ******************************Code Section 1: Add In Variable Declarations******************************
  2.     dim ItemHighlight, 1500
  3.  
  4. ******************************Code Section 2: Add In C Function itemname******************************
  5. //Before "if ( inv(8, itemname_arg1) == 0 ) {"
  6. //itemname_arg1 is prm_574
  7.     if(ItemHighlight(inv(3, itemname_arg1)) == 1){
  8.         s@m63 ="*****" + s@m63
  9.     }
  10.  
  11. ******************************Code Section 3: Insert At Startup Code******************************
  12. //After Card/Item Export gosubs
  13. gosub *Load_Item_Highlights
  14.  
  15. ******************************Code Section 4: Insert Anywhere******************************
  16.  
  17. /*
  18.     Uses data from the ItemList.txt file to store a set of preferences in order to highlight user-specified items.
  19.     Error-Checking is minimal; careless modification of ItemList.txt may cause crashing.
  20.     Optimization Options:
  21.     (Minimal) Splitting EN/JP into separate files would halve the number of lines to be processed.
  22. */
  23. *Load_Item_Highlights  
  24.     //Verify that the ItemList file exists, displaying an error message and returning if not.
  25.     //If no file is found, the default value is 0 and no items will be highlighted. Will not cause crashing.
  26.     exist exedir + "ItemList.txt"
  27.     if( strsize == (-1)) {
  28.         dialog "The Item List file does not exist. Preferences will not be loaded."
  29.         return
  30.     } else{
  31.         //Clear the variables to be used and prepare the buffer.
  32.         buf = ""
  33.         ReturnString = ""
  34.         notesel buf
  35.         noteload exedir + "ItemList.txt"
  36.         //Loop through the file, reading line by line.
  37.         repeat noteinfo(0)
  38.             noteget FileLoadString_1, cnt
  39.             //Look only at lines that match the game's language settings.
  40.             if( instr( FileLoadString_1, 0, lang(".JP", ".EN")) != (-1)){
  41.                 //Tempvar_1 stores the ID found in the line
  42.                 TempVar_1 = strmid(FileLoadString_1, 0, instr(FileLoadString_1, 0, "."))
  43.                 LoopCount = 0
  44.                 //Loop to the last tab in the line, and read that value into ItemHighlight.
  45.                 while LoopCount < 3
  46.                     StringOffset = instr(FileLoadString_1, 0, "\t")
  47.                     FileLoadString_1 = strmid(FileLoadString_1, StringOffset + 1, strlen(FileLoadString_1) - StringOffset)
  48.    
  49.                     if(LoopCount == 2){
  50.                         ItemHighlight(int(TempVar_1)) = int(FileLoadString_1)
  51.                     }
  52.                     LoopCount++
  53.                 wend
  54.             }
  55.         loop
  56.         noteunsel
  57.     }
  58.     noteunsel
  59. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement