Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ******************************Code Section 1: Add In Variable Declarations******************************
- dim ItemHighlight, 1500
- ******************************Code Section 2: Add In C Function itemname******************************
- //Before "if ( inv(8, itemname_arg1) == 0 ) {"
- //itemname_arg1 is prm_574
- if(ItemHighlight(inv(3, itemname_arg1)) == 1){
- s@m63 ="*****" + s@m63
- }
- ******************************Code Section 3: Insert At Startup Code******************************
- //After Card/Item Export gosubs
- gosub *Load_Item_Highlights
- ******************************Code Section 4: Insert Anywhere******************************
- /*
- Uses data from the ItemList.txt file to store a set of preferences in order to highlight user-specified items.
- Error-Checking is minimal; careless modification of ItemList.txt may cause crashing.
- Optimization Options:
- (Minimal) Splitting EN/JP into separate files would halve the number of lines to be processed.
- */
- *Load_Item_Highlights
- //Verify that the ItemList file exists, displaying an error message and returning if not.
- //If no file is found, the default value is 0 and no items will be highlighted. Will not cause crashing.
- exist exedir + "ItemList.txt"
- if( strsize == (-1)) {
- dialog "The Item List file does not exist. Preferences will not be loaded."
- return
- } else{
- //Clear the variables to be used and prepare the buffer.
- buf = ""
- ReturnString = ""
- notesel buf
- noteload exedir + "ItemList.txt"
- //Loop through the file, reading line by line.
- repeat noteinfo(0)
- noteget FileLoadString_1, cnt
- //Look only at lines that match the game's language settings.
- if( instr( FileLoadString_1, 0, lang(".JP", ".EN")) != (-1)){
- //Tempvar_1 stores the ID found in the line
- TempVar_1 = strmid(FileLoadString_1, 0, instr(FileLoadString_1, 0, "."))
- LoopCount = 0
- //Loop to the last tab in the line, and read that value into ItemHighlight.
- while LoopCount < 3
- StringOffset = instr(FileLoadString_1, 0, "\t")
- FileLoadString_1 = strmid(FileLoadString_1, StringOffset + 1, strlen(FileLoadString_1) - StringOffset)
- if(LoopCount == 2){
- ItemHighlight(int(TempVar_1)) = int(FileLoadString_1)
- }
- LoopCount++
- wend
- }
- loop
- noteunsel
- }
- noteunsel
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement