#include "CFilePlugin.h" #include "CPluginInfo.h" #include "CResFile.h" CFilePlugin::CFilePlugin(DWORD type, T2PluginSpecifier& specifier) : CPlugin(type, specifier) { mAttrib = 0; mGameLevel = 0; CResFile file; int success = false; if (specifier.mIsSubPlugin) { success = file.OpenResource(specifier.mPath, 128, 'ATTR'); specifier.mIsLoaded = true; } else { success = file.OpenResource(specifier.mInstance, 128, "Attr"); } if (success) { file >> mID; file >> mAttrib; file >> mDependID; file >> mGameLevel; file >> mSecretItem; file >> mItemType; file >> mMustItem; file >> mPluginName; } } /*virtual*/ CFilePlugin::~CFilePlugin() { Unload(); } /*virtual*/ void CFilePlugin::GetName(CString& outStr) { outStr = mPluginName; } /*virtual*/ BOOL CFilePlugin::Load() { return true; } /*virtual*/ BOOL CFilePlugin::Unload() { return true; } CPluginInfo* CFilePlugin::GetPluginInfo() { char buf[500]; GetModuleFileName(mModuleHandle, buf, sizeof(buf)); return new CPluginInfo(mType, mID, mItemType, mMustItem, mPluginName, buf); }