3ds Max C++ API Reference
script_resource_file_utils.h File Reference
#include "../ScripterExport.h"
#include "../../strclass.h"

Functions

ScripterExport bool LocateScriptResourceFile (const MCHAR *scriptFileName, MSTR &resourceFileName)
 Locates the resource file for the specified script file name. More...
 
ScripterExport HashTableLoadScriptResourceFile (const MCHAR *resourceFileName)
 Loads the specified resource file. More...
 
ScripterExport MSTR GetSystemLocaleName (bool user_default_locale)
 Returns the system's localization language and country name. More...
 

Function Documentation

◆ LocateScriptResourceFile()

ScripterExport bool LocateScriptResourceFile ( const MCHAR scriptFileName,
MSTR resourceFileName 
)

Locates the resource file for the specified script file name.

The filename portion of the resource file name is the script file name plus a ".res" extension ([script.res] = <scriptname>.res). The resource file is looked for in the following locations, in the order given:

  • The directory the script file is in ([scriptdir][script.res])
  • A subdirectory of the directory the script file is in, where the subdirectory name is the localization name (en-US, fr-FR, ja-JP, etc.) ([scriptdir]<lang>[script.res])
  • IFF script is in install tree, the localized shadow directory under the install directory ([installdir]<lang>[shadow tree][script.res])
  • The en-US subdirectory of the directory the script file is in ([scriptdir]\en-US[script.res])
  • IFF script is in install tree, the english shadow directory under the install directory ([installdir]\en-US[shadow tree][script.res])
Parameters
[in]scriptFileName- The fully qualified script file name
[out]resourceFileName- The resource file name if found
Returns
True if the resource file name was located.

◆ LoadScriptResourceFile()

ScripterExport HashTable* LoadScriptResourceFile ( const MCHAR resourceFileName)

Loads the specified resource file.

Each line in the resource file consists of the resource id and the resource value. This creates and returns a HashTable where the resource id is the key and the resource value is the value. If the resource file does not exist, NULL will be returned.

Parameters
resourceFileName- The fully qualified resource file name
Returns
Pointer to HashTable containing the resource id/resource value pairs, or NULL if the resource file doesn't exist. Note: this function will throw a MAXScriptException if an error occurs while processing the resource file

◆ GetSystemLocaleName()

ScripterExport MSTR GetSystemLocaleName ( bool  user_default_locale)

Returns the system's localization language and country name.

The system's localization language and country name are determined by querying the system for its ISO languange and country locale names.

Parameters
[in]user_default_locale- If true, default locale for the user is returned. If false, default locale for the system is returned.
Returns
The system's 2-letter localization language and country names in the form <language>-<country>, for example, 'en-US'.