Merge pull request #1518 from oddMLan/master

Introduce new unified "Name" column & enable it by default
This commit is contained in:
zilmar 2018-12-09 21:36:02 +10:30 committed by GitHub
commit aa1ace5746
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 39 additions and 7 deletions

View File

@ -175,6 +175,7 @@
#317# "Jogadores"
#318# "Force Feedback"
#319# "Formato do Arquivo"
#321# "Nome"
//Select ROM
#320# "Selecionar o diretório atual das ROMs"

View File

@ -175,6 +175,7 @@
#317# "游戏人数"
#318# "强制力回馈"
#319# "文件格式"
#321# "名称"
//Select ROM
#320# "选择当前的 ROM 目录"

View File

@ -175,6 +175,7 @@
#317# "Players"
#318# "Force Feedback"
#319# "File Format"
#321# "Name"
//Select ROM
#320# "Select current ROM directory"

View File

@ -175,6 +175,7 @@
#317# "Joueurs"
#318# "Forcer le feedback"
#319# "Format de fichier"
#321# "Nom"
//Select ROM
#320# "Sélectionner le répertoire de ROM actuel"

View File

@ -189,6 +189,7 @@
#317# "プレイヤー"
#318# "振動機能"
#319# "ファイル形式"
#321# "名前"
//Select ROM
#320# "ロムディレクトリを選択して下さい"

View File

@ -175,6 +175,7 @@
#317# "Игроков"
#318# "Вибрация"
#319# "Формат файла"
#321# "имя"
//Select ROM
#320# "Выбрать текущую папку с играми"

View File

@ -175,6 +175,7 @@
#317# "Jugadores"
#318# "Retroalimentación de Fuerza"
#319# "Formato del Archivo"
#321# "Nombre"
//Select ROM
#320# "Seleccionar directorio de ROMs actual"

View File

@ -205,6 +205,8 @@ enum LanguageStringID
RB_PLAYERS = 317,
RB_FORCE_FEEDBACK = 318,
RB_FILE_FORMAT = 319,
RB_NAME = 321,
//Select Rom
SELECT_ROM_DIR = 320,

View File

@ -156,6 +156,7 @@ void CLanguage::LoadDefaultStrings(void)
DEF_STR(RB_FILENAME, "File Name");
DEF_STR(RB_INTERNALNAME, "Internal Name");
DEF_STR(RB_GOODNAME, "Good Name");
DEF_STR(RB_NAME, "Name");
DEF_STR(RB_STATUS, "Status");
DEF_STR(RB_ROMSIZE, "ROM Size");
DEF_STR(RB_NOTES_CORE, "Notes (core)");

View File

@ -468,6 +468,7 @@ void CRomList::FillRomExtensionInfo(ROM_INFO * pRomInfo)
pRomInfo->CoreNotes[0] = '\0';
pRomInfo->PluginNotes[0] = '\0';
strcpy(pRomInfo->GoodName, "#340#");
strcpy(pRomInfo->Name, "#321#");
strcpy(pRomInfo->Status, "Unknown");
//Get File Identifier
@ -486,6 +487,7 @@ void CRomList::FillRomExtensionInfo(ROM_INFO * pRomInfo)
//Rom Settings
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->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));

View File

@ -34,6 +34,7 @@ public:
char FileName[200];
char InternalName[22];
char GoodName[200];
char Name[200];
char CartID[3];
char PluginNotes[250];
char CoreNotes[250];

View File

@ -109,12 +109,12 @@ private:
enum
{
RB_FileName = 0, RB_InternalName = 1, RB_GoodName = 2,
RB_Status = 3, RB_RomSize = 4, RB_CoreNotes = 5,
RB_PluginNotes = 6, RB_UserNotes = 7, RB_CartridgeID = 8,
RB_Manufacturer = 9, RB_Country = 10, RB_Developer = 11,
RB_Crc1 = 12, RB_Crc2 = 13, RB_CICChip = 14,
RB_ReleaseDate = 15, RB_Genre = 16, RB_Players = 17,
RB_ForceFeedback = 18, RB_FileFormat = 19
RB_Name = 3, RB_Status = 4, RB_RomSize = 5,
RB_CoreNotes = 6, RB_PluginNotes = 7, RB_UserNotes = 8,
RB_CartridgeID = 9, RB_Manufacturer = 10, RB_Country = 11,
RB_Developer = 12, RB_Crc1 = 13, RB_Crc2 = 14,
RB_CICChip = 15, RB_ReleaseDate = 16, RB_Genre = 17,
RB_Players = 18, RB_ForceFeedback = 19, RB_FileFormat = 20
};
enum

View File

@ -49,7 +49,8 @@ void CRomBrowser::GetFieldInfo(ROMBROWSER_FIELDS_LIST & Fields, bool UseDefault
AddField(Fields, "File Name", -1, RB_FileName, 218, RB_FILENAME, UseDefault);
AddField(Fields, "Internal Name", -1, RB_InternalName, 200, RB_INTERNALNAME, UseDefault);
AddField(Fields, "Good Name", 0, RB_GoodName, 218, RB_GOODNAME, UseDefault);
AddField(Fields, "Good Name", -1, RB_GoodName, 218, RB_GOODNAME, UseDefault);
AddField(Fields, "Name", 0, RB_Name, 218, RB_NAME, UseDefault);
AddField(Fields, "Status", 1, RB_Status, 92, RB_STATUS, UseDefault);
AddField(Fields, "Rom Size", -1, RB_RomSize, 100, RB_ROMSIZE, UseDefault);
AddField(Fields, "Notes (Core)", 2, RB_CoreNotes, 120, RB_NOTES_CORE, UseDefault);
@ -535,6 +536,10 @@ bool CRomBrowser::RomListDrawItem(int32_t idCtrl, uint32_t lParam)
{
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);
@ -556,6 +561,11 @@ bool CRomBrowser::RomListDrawItem(int32_t idCtrl, uint32_t lParam)
{
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);
}
return true;
@ -640,11 +650,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();
}
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)
{
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_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_RomSize: result = (int32_t)pRomInfo1->RomSize - (int32_t)pRomInfo2->RomSize; break;
case RB_CoreNotes: result = (int32_t)lstrcmpi(pRomInfo1->CoreNotes, pRomInfo2->CoreNotes); break;
@ -688,6 +706,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_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_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_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;