MRI: Revise 'MKXP.data_directory' behavior
This function which was formerly a simple wrapper around SLD_GetPrefPath() is changed to instead return the directory assembled from org/app name specified in mkxp.conf, so one can be sure that both mkxp and user scripts will always write into the same directory when a custom path is preferred.
This commit is contained in:
		
							parent
							
								
									af8f3a36d2
								
							
						
					
					
						commit
						ecf9b065c8
					
				
					 1 changed files with 1 additions and 11 deletions
				
			
		| 
						 | 
					@ -193,17 +193,7 @@ RB_METHOD(mkxpDataDirectory)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	RB_UNUSED_PARAM;
 | 
						RB_UNUSED_PARAM;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const char *org, *app;
 | 
						return rb_str_new_cstr(shState->config().customDataPath.c_str());
 | 
				
			||||||
 | 
					 | 
				
			||||||
	rb_get_args(argc, argv, "zz", &org, &app RB_ARG_END);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	char *path = SDL_GetPrefPath(org, app);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	VALUE pathStr = rb_str_new_cstr(path);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	SDL_free(path);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return pathStr;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RB_METHOD(mkxpPuts)
 | 
					RB_METHOD(mkxpPuts)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue