[Rom Browser] Add "Name" column
Do not renumber items in the language file
This commit is contained in:
parent
d7ad7be6cb
commit
28bd4ab983
|
@ -205,6 +205,8 @@ enum LanguageStringID
|
||||||
RB_PLAYERS = 317,
|
RB_PLAYERS = 317,
|
||||||
RB_FORCE_FEEDBACK = 318,
|
RB_FORCE_FEEDBACK = 318,
|
||||||
RB_FILE_FORMAT = 319,
|
RB_FILE_FORMAT = 319,
|
||||||
|
RB_NAME = 321,
|
||||||
|
|
||||||
|
|
||||||
//Select Rom
|
//Select Rom
|
||||||
SELECT_ROM_DIR = 320,
|
SELECT_ROM_DIR = 320,
|
||||||
|
|
|
@ -156,6 +156,7 @@ void CLanguage::LoadDefaultStrings(void)
|
||||||
DEF_STR(RB_FILENAME, "File Name");
|
DEF_STR(RB_FILENAME, "File Name");
|
||||||
DEF_STR(RB_INTERNALNAME, "Internal Name");
|
DEF_STR(RB_INTERNALNAME, "Internal Name");
|
||||||
DEF_STR(RB_GOODNAME, "Good Name");
|
DEF_STR(RB_GOODNAME, "Good Name");
|
||||||
|
DEF_STR(RB_NAME, "Name");
|
||||||
DEF_STR(RB_STATUS, "Status");
|
DEF_STR(RB_STATUS, "Status");
|
||||||
DEF_STR(RB_ROMSIZE, "ROM Size");
|
DEF_STR(RB_ROMSIZE, "ROM Size");
|
||||||
DEF_STR(RB_NOTES_CORE, "Notes (core)");
|
DEF_STR(RB_NOTES_CORE, "Notes (core)");
|
||||||
|
|
|
@ -468,6 +468,7 @@ void CRomList::FillRomExtensionInfo(ROM_INFO * pRomInfo)
|
||||||
pRomInfo->CoreNotes[0] = '\0';
|
pRomInfo->CoreNotes[0] = '\0';
|
||||||
pRomInfo->PluginNotes[0] = '\0';
|
pRomInfo->PluginNotes[0] = '\0';
|
||||||
strcpy(pRomInfo->GoodName, "#340#");
|
strcpy(pRomInfo->GoodName, "#340#");
|
||||||
|
strcpy(pRomInfo->Name, "#321#");
|
||||||
strcpy(pRomInfo->Status, "Unknown");
|
strcpy(pRomInfo->Status, "Unknown");
|
||||||
|
|
||||||
//Get File Identifier
|
//Get File Identifier
|
||||||
|
@ -486,6 +487,7 @@ void CRomList::FillRomExtensionInfo(ROM_INFO * pRomInfo)
|
||||||
|
|
||||||
//Rom Settings
|
//Rom Settings
|
||||||
strncpy(pRomInfo->GoodName, m_RomIniFile->GetString(Identifier, "Good Name", pRomInfo->GoodName).c_str(), sizeof(pRomInfo->GoodName) / sizeof(char));
|
strncpy(pRomInfo->GoodName, m_RomIniFile->GetString(Identifier, "Good Name", pRomInfo->GoodName).c_str(), sizeof(pRomInfo->GoodName) / sizeof(char));
|
||||||
|
strncpy(pRomInfo->Name, m_RomIniFile->GetString(Identifier, "Good Name", pRomInfo->Name).c_str(), sizeof(pRomInfo->Name) / sizeof(char));
|
||||||
strncpy(pRomInfo->Status, m_RomIniFile->GetString(Identifier, "Status", pRomInfo->Status).c_str(), sizeof(pRomInfo->Status) / sizeof(char));
|
strncpy(pRomInfo->Status, m_RomIniFile->GetString(Identifier, "Status", pRomInfo->Status).c_str(), sizeof(pRomInfo->Status) / sizeof(char));
|
||||||
strncpy(pRomInfo->CoreNotes, m_RomIniFile->GetString(Identifier, "Core Note", "").c_str(), sizeof(pRomInfo->CoreNotes) / sizeof(char));
|
strncpy(pRomInfo->CoreNotes, m_RomIniFile->GetString(Identifier, "Core Note", "").c_str(), sizeof(pRomInfo->CoreNotes) / sizeof(char));
|
||||||
strncpy(pRomInfo->PluginNotes, m_RomIniFile->GetString(Identifier, "Plugin Note", "").c_str(), sizeof(pRomInfo->PluginNotes) / sizeof(char));
|
strncpy(pRomInfo->PluginNotes, m_RomIniFile->GetString(Identifier, "Plugin Note", "").c_str(), sizeof(pRomInfo->PluginNotes) / sizeof(char));
|
||||||
|
|
|
@ -34,6 +34,7 @@ public:
|
||||||
char FileName[200];
|
char FileName[200];
|
||||||
char InternalName[22];
|
char InternalName[22];
|
||||||
char GoodName[200];
|
char GoodName[200];
|
||||||
|
char Name[200];
|
||||||
char CartID[3];
|
char CartID[3];
|
||||||
char PluginNotes[250];
|
char PluginNotes[250];
|
||||||
char CoreNotes[250];
|
char CoreNotes[250];
|
||||||
|
|
|
@ -109,12 +109,12 @@ private:
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
RB_FileName = 0, RB_InternalName = 1, RB_GoodName = 2,
|
RB_FileName = 0, RB_InternalName = 1, RB_GoodName = 2,
|
||||||
RB_Status = 3, RB_RomSize = 4, RB_CoreNotes = 5,
|
RB_Name = 3, RB_Status = 4, RB_RomSize = 5,
|
||||||
RB_PluginNotes = 6, RB_UserNotes = 7, RB_CartridgeID = 8,
|
RB_CoreNotes = 6, RB_PluginNotes = 7, RB_UserNotes = 8,
|
||||||
RB_Manufacturer = 9, RB_Country = 10, RB_Developer = 11,
|
RB_CartridgeID = 9, RB_Manufacturer = 10, RB_Country = 11,
|
||||||
RB_Crc1 = 12, RB_Crc2 = 13, RB_CICChip = 14,
|
RB_Developer = 12, RB_Crc1 = 13, RB_Crc2 = 14,
|
||||||
RB_ReleaseDate = 15, RB_Genre = 16, RB_Players = 17,
|
RB_CICChip = 15, RB_ReleaseDate = 16, RB_Genre = 17,
|
||||||
RB_ForceFeedback = 18, RB_FileFormat = 19
|
RB_Players = 18, RB_ForceFeedback = 19, RB_FileFormat = 20
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
|
|
@ -535,6 +535,10 @@ bool CRomBrowser::RomListDrawItem(int32_t idCtrl, uint32_t lParam)
|
||||||
{
|
{
|
||||||
text = wGS(RB_NOT_GOOD_FILE);
|
text = wGS(RB_NOT_GOOD_FILE);
|
||||||
}
|
}
|
||||||
|
if (wcscmp(L"#321#", text.c_str()) == 0)
|
||||||
|
{
|
||||||
|
text = stdstr(pRomInfo->InternalName).ToUTF16();
|
||||||
|
}
|
||||||
|
|
||||||
DrawTextW(ditem->hDC, text.c_str(), text.length(), &rcDraw, DT_LEFT | DT_SINGLELINE | DT_NOPREFIX | DT_VCENTER | DT_WORD_ELLIPSIS);
|
DrawTextW(ditem->hDC, text.c_str(), text.length(), &rcDraw, DT_LEFT | DT_SINGLELINE | DT_NOPREFIX | DT_VCENTER | DT_WORD_ELLIPSIS);
|
||||||
|
|
||||||
|
@ -556,6 +560,11 @@ bool CRomBrowser::RomListDrawItem(int32_t idCtrl, uint32_t lParam)
|
||||||
{
|
{
|
||||||
text = wGS(RB_NOT_GOOD_FILE);
|
text = wGS(RB_NOT_GOOD_FILE);
|
||||||
}
|
}
|
||||||
|
if (wcscmp(L"#321#", text.c_str()) == 0)
|
||||||
|
{
|
||||||
|
text = stdstr(pRomInfo->InternalName).ToUTF16();
|
||||||
|
}
|
||||||
|
|
||||||
DrawTextW(ditem->hDC, text.c_str(), text.length(), &rcDraw, DT_LEFT | DT_SINGLELINE | DT_NOPREFIX | DT_VCENTER | DT_WORD_ELLIPSIS);
|
DrawTextW(ditem->hDC, text.c_str(), text.length(), &rcDraw, DT_LEFT | DT_SINGLELINE | DT_NOPREFIX | DT_VCENTER | DT_WORD_ELLIPSIS);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -640,11 +649,19 @@ int32_t CALLBACK CRomBrowser::RomList_CompareItems(uint32_t lParam1, uint32_t lP
|
||||||
GoodName2 = strcmp("#340#", pRomInfo2->GoodName) != 0 ? pRomInfo2->GoodName : m_UnknownGoodName.c_str();
|
GoodName2 = strcmp("#340#", pRomInfo2->GoodName) != 0 ? pRomInfo2->GoodName : m_UnknownGoodName.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char * Name1 = NULL, *Name2 = NULL;
|
||||||
|
if (SortFieldInfo->Key == RB_Name)
|
||||||
|
{
|
||||||
|
Name1 = strcmp("#321#", pRomInfo1->Name) != 0 ? pRomInfo1->GoodName : pRomInfo1->InternalName;
|
||||||
|
Name2 = strcmp("#321#", pRomInfo2->Name) != 0 ? pRomInfo2->GoodName : pRomInfo2->InternalName;
|
||||||
|
}
|
||||||
|
|
||||||
switch (SortFieldInfo->Key)
|
switch (SortFieldInfo->Key)
|
||||||
{
|
{
|
||||||
case RB_FileName: result = (int32_t)lstrcmpi(pRomInfo1->FileName, pRomInfo2->FileName); break;
|
case RB_FileName: result = (int32_t)lstrcmpi(pRomInfo1->FileName, pRomInfo2->FileName); break;
|
||||||
case RB_InternalName: result = (int32_t)lstrcmpi(pRomInfo1->InternalName, pRomInfo2->InternalName); break;
|
case RB_InternalName: result = (int32_t)lstrcmpi(pRomInfo1->InternalName, pRomInfo2->InternalName); break;
|
||||||
case RB_GoodName: result = (int32_t)lstrcmpi(GoodName1, GoodName2); break;
|
case RB_GoodName: result = (int32_t)lstrcmpi(GoodName1, GoodName2); break;
|
||||||
|
case RB_Name: result = (int32_t)lstrcmpi(Name1, Name2); break;
|
||||||
case RB_Status: result = (int32_t)lstrcmpi(pRomInfo1->Status, pRomInfo2->Status); break;
|
case RB_Status: result = (int32_t)lstrcmpi(pRomInfo1->Status, pRomInfo2->Status); break;
|
||||||
case RB_RomSize: result = (int32_t)pRomInfo1->RomSize - (int32_t)pRomInfo2->RomSize; break;
|
case RB_RomSize: result = (int32_t)pRomInfo1->RomSize - (int32_t)pRomInfo2->RomSize; break;
|
||||||
case RB_CoreNotes: result = (int32_t)lstrcmpi(pRomInfo1->CoreNotes, pRomInfo2->CoreNotes); break;
|
case RB_CoreNotes: result = (int32_t)lstrcmpi(pRomInfo1->CoreNotes, pRomInfo2->CoreNotes); break;
|
||||||
|
@ -688,6 +705,7 @@ void CRomBrowser::RomList_GetDispInfo(uint32_t pnmh)
|
||||||
case RB_FileName: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->FileName).ToUTF16(CP_ACP).c_str(), lpdi->item.cchTextMax); break;
|
case RB_FileName: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->FileName).ToUTF16(CP_ACP).c_str(), lpdi->item.cchTextMax); break;
|
||||||
case RB_InternalName: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->InternalName).ToUTF16(stdstr::CODEPAGE_932).c_str(), lpdi->item.cchTextMax / sizeof(wchar_t)); break;
|
case RB_InternalName: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->InternalName).ToUTF16(stdstr::CODEPAGE_932).c_str(), lpdi->item.cchTextMax / sizeof(wchar_t)); break;
|
||||||
case RB_GoodName: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->GoodName).ToUTF16().c_str(), lpdi->item.cchTextMax / sizeof(wchar_t)); break;
|
case RB_GoodName: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->GoodName).ToUTF16().c_str(), lpdi->item.cchTextMax / sizeof(wchar_t)); break;
|
||||||
|
case RB_Name: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->Name).ToUTF16().c_str(), lpdi->item.cchTextMax / sizeof(wchar_t)); break;
|
||||||
case RB_CoreNotes: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->CoreNotes).ToUTF16().c_str(), lpdi->item.cchTextMax / sizeof(wchar_t)); break;
|
case RB_CoreNotes: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->CoreNotes).ToUTF16().c_str(), lpdi->item.cchTextMax / sizeof(wchar_t)); break;
|
||||||
case RB_PluginNotes: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->PluginNotes).ToUTF16().c_str(), lpdi->item.cchTextMax / sizeof(wchar_t)); break;
|
case RB_PluginNotes: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->PluginNotes).ToUTF16().c_str(), lpdi->item.cchTextMax / sizeof(wchar_t)); break;
|
||||||
case RB_Status: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->Status).ToUTF16().c_str(), lpdi->item.cchTextMax / sizeof(wchar_t)); break;
|
case RB_Status: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->Status).ToUTF16().c_str(), lpdi->item.cchTextMax / sizeof(wchar_t)); break;
|
||||||
|
|
Loading…
Reference in New Issue