summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2PeopleInfoDialog.cpp
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-07-01 02:43:29 +0100
committerAsh Wolf <ninji@wuffs.org>2023-07-01 02:43:29 +0100
commit5c6a48b2ff362a70416a6a00fda7d06e0f276f2d (patch)
tree62cf542c68d91aa6f7a4e3bfa9eddca4ab352970 /src/T2DLL/T2PeopleInfoDialog.cpp
parentc0c336500955a23e344651e5412c9d9d441ef4ee (diff)
downloadt2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.tar.gz
t2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.zip
i am in hell
Diffstat (limited to '')
-rw-r--r--src/T2DLL/T2PeopleInfoDialog.cpp91
1 files changed, 47 insertions, 44 deletions
diff --git a/src/T2DLL/T2PeopleInfoDialog.cpp b/src/T2DLL/T2PeopleInfoDialog.cpp
index c57f233..26b98a4 100644
--- a/src/T2DLL/T2PeopleInfoDialog.cpp
+++ b/src/T2DLL/T2PeopleInfoDialog.cpp
@@ -27,6 +27,7 @@ T2PeopleInfoDialog::T2PeopleInfoDialog(T2People* people)
}
/*virtual*/ void T2PeopleInfoDialog::OnT2Create() {
+#pragma var_order(item1040, item1012, item7090, favName, item1030, item1010, item1020, item1011, pplEvalGage, theName, str1, nonFavName, theWorldDef, stressGage, hasAnyName, str2, theTowerDoc, theSilhouettePane, theNameID)
T2TowerDoc *theTowerDoc = mTowerDoc;
T2WorldDef *theWorldDef = GetCurrentT2TowerDoc()->towerDoc_vf170();
@@ -66,6 +67,7 @@ T2PeopleInfoDialog::T2PeopleInfoDialog(T2People* people)
// 1030 - where they're going from
T2DlgItem *item1030 = (T2DlgItem *) GetDlgItem(1030);
if (mPeople->GetWorkTenant() > 1) {
+#pragma var_order(item1010, nameStr, workTenant, workTenantName, theNameID)
T2Tenant *workTenant = theTowerDoc->mFloorInfo->GetTenant(mPeople->GetWorkTenant());
T2Name *workTenantName = theTowerDoc->mNameDB->Search(workTenant, false);
@@ -136,6 +138,7 @@ T2PeopleInfoDialog::T2PeopleInfoDialog(T2People* people)
str1 = "\x82\xC8\x82\xB5";
}
+#pragma var_order(item1040, item1012, item7090, favName, item1030, item1010, item1020, item1011, pplEvalGage, theName, str1, nonFavName, theWorldDef, stressGage, hasAnyName, str2, theTowerDoc, theSilhouettePane, theNameID)
// 1040 - where they're going to
T2DlgItem *item1040 = (T2DlgItem *) GetDlgItem(1040);
item1040->SetDescriptor(str1);
@@ -143,7 +146,7 @@ T2PeopleInfoDialog::T2PeopleInfoDialog(T2People* people)
T2DlgItemStressGage *stressGage = (T2DlgItemStressGage *) GetDlgItem(110);
stressGage->SetPeople(mPeople);
- T2DlgItemPPLEvalGage *pplEvalGage = (T2DlgItemPPLEvalGage *) GetDlgItem(126);
+ T2DlgItemPPLEvalGage *pplEvalGage = (T2DlgItemPPLEvalGage *) GetDlgItem(120);
pplEvalGage->SetPeople(mPeople);
BOOL hasAnyName = false;
@@ -166,27 +169,27 @@ T2PeopleInfoDialog::T2PeopleInfoDialog(T2People* people)
}
CString T2PeopleInfoDialog::GetTenantName(T2TowerDoc* towerDoc, unsigned int inTenantID) {
- CString result = "";
+ CString resultName = "";
unsigned int tenantID = inTenantID;
if (tenantID == 1) {
// "ロビー" - lobby
- result = "\x83\x8D\x83\x72\x81\x5B";
+ resultName = "\x83\x8D\x83\x72\x81\x5B";
} else {
- CString str;
+ CString roomNum;
T2Tenant *theTenant = towerDoc->mFloorInfo->GetTenant(tenantID);
T2Name *theName = towerDoc->mNameDB->Search(theTenant, false);
- UT2Utils::GetRoomNumberString(theTenant->GetFloorNumber(towerDoc->mFloorInfo), result);
- UT2Utils::GetRoomNumberString(theTenant->GetRoomNumber(towerDoc->mFloorInfo), str);
+ UT2Utils::GetRoomNumberString(theTenant->GetFloorNumber(towerDoc->mFloorInfo), resultName);
+ UT2Utils::GetRoomNumberString(theTenant->GetRoomNumber(towerDoc->mFloorInfo), roomNum);
- // "階" + str + "号室" - floor + ... + room number
- result = result + "\x8A\x4B" + str + "\x8D\x86\x8E\xBA ";
+ // "階" + roomNum + "号室" - floor + ... + room number
+ resultName = resultName + "\x8A\x4B" + roomNum + "\x8D\x86\x8E\xBA ";
CString nameStr;
- unsigned int theNameID;
+ unsigned int id;
if (theName)
- theName->GetName(nameStr, theNameID);
+ theName->GetName(nameStr, id);
if (nameStr == "") {
T2ToolDef *toolDef = (T2ToolDef *) theTenant->GetEquipDef();
@@ -194,37 +197,37 @@ CString T2PeopleInfoDialog::GetTenantName(T2TowerDoc* towerDoc, unsigned int inT
toolDef->GetName(nameStr, 0);
}
- result += nameStr;
+ resultName += nameStr;
}
- return result;
+ return resultName;
}
/*virtual*/ void T2PeopleInfoDialog::CreateDlgItem(CTokenizer& tokenizer, T2DialogDef& def) {
if (!_stricmp(tokenizer.Current(), "SILH")) {
- RECT rect;
- int id = tokenizer.NextInteger();
- rect.left = tokenizer.NextInteger();
- rect.top = tokenizer.NextInteger();
- rect.right = tokenizer.NextInteger();
- rect.bottom = tokenizer.NextInteger();
-
- T2SilhouettePane *silhouettePane = new T2SilhouettePane(mTowerDoc, mImageObj, mPalette);
- silhouettePane->Create("", def.flags, rect, this, id);
+ RECT theItemRect;
+ int theID = tokenizer.NextInteger();
+ theItemRect.left = tokenizer.NextInteger();
+ theItemRect.top = tokenizer.NextInteger();
+ theItemRect.right = tokenizer.NextInteger();
+ theItemRect.bottom = tokenizer.NextInteger();
+
+ T2SilhouettePane *item = new T2SilhouettePane(mTowerDoc, mImageObj, mPalette);
+ item->Create("", def.flags, theItemRect, this, theID);
if (mCurrentFont >= 0)
- silhouettePane->SetFont(*mFonts[mCurrentFont]);
+ item->SetFont(*mFonts[mCurrentFont]);
} else if (!_stricmp(tokenizer.Current(), "PPLEV")) {
- RECT rect;
- int id = tokenizer.NextInteger();
- rect.left = tokenizer.NextInteger();
- rect.top = tokenizer.NextInteger();
- rect.right = tokenizer.NextInteger();
- rect.bottom = tokenizer.NextInteger();
-
- T2DlgItemPPLEvalGage *pplEvalGage = new T2DlgItemPPLEvalGage(mTowerDoc, mImageObj, mPalette);
- pplEvalGage->Create("", def.flags, rect, this, id);
+ RECT theItemRect;
+ int theID = tokenizer.NextInteger();
+ theItemRect.left = tokenizer.NextInteger();
+ theItemRect.top = tokenizer.NextInteger();
+ theItemRect.right = tokenizer.NextInteger();
+ theItemRect.bottom = tokenizer.NextInteger();
+
+ T2DlgItemPPLEvalGage *item = new T2DlgItemPPLEvalGage(mTowerDoc, mImageObj, mPalette);
+ item->Create("", def.flags, theItemRect, this, theID);
if (mCurrentFont >= 0)
- pplEvalGage->SetFont(*mFonts[mCurrentFont]);
+ item->SetFont(*mFonts[mCurrentFont]);
} else {
T2Dialog::CreateDlgItem(tokenizer, def);
}
@@ -233,23 +236,23 @@ CString T2PeopleInfoDialog::GetTenantName(T2TowerDoc* towerDoc, unsigned int inT
/*virtual*/ void T2PeopleInfoDialog::OnT2Destroy() {
}
-/*virtual*/ BOOL T2PeopleInfoDialog::OnT2DialogCommand(UINT cmd, long data) {
- WORD hi = HIWORD(cmd);
- WORD lo = LOWORD(cmd);
+/*virtual*/ BOOL T2PeopleInfoDialog::OnT2DialogCommand(WPARAM inWParam, LPARAM inLParam) {
+ WORD code = HIWORD(inWParam);
+ WORD id = LOWORD(inWParam);
- if (lo == 1 && hi == 0) {
+ if (id == IDOK && code == 0) {
// nothing
- } else if (lo == 2 && hi == 0) {
+ } else if (id == IDCANCEL && code == 0) {
// wtf is going on here? compiler uses a different register
DestroyWindow();
- } else if (lo == 7090 && hi == 0) {
+ } else if (id == 7090 && code == 0) {
m104 = true;
GetT2DlgItem(7090)->EnableWindow(false);
T2DlgItem *item = (T2DlgItem *) GetDlgItem(1010);
- CString str;
- item->GetDescriptor(str);
- if (str == "")
+ CString text;
+ item->GetDescriptor(text);
+ if (text == "")
item->SetDescriptor(m108);
}
@@ -268,9 +271,9 @@ CString T2PeopleInfoDialog::GetTenantName(T2TowerDoc* towerDoc, unsigned int inT
nameStr = m108;
if (m108 != nameStr || m104 == 1) {
- T2Name *nonFavName = mTowerDoc->mNameDB->Search(mPeople, false);
- if (nonFavName) {
- nonFavName->SetName(nameStr);
+ T2Name *name = mTowerDoc->mNameDB->Search(mPeople, false);
+ if (name) {
+ name->SetName(nameStr);
} else {
T2Name *newName = new T2Name(nameStr, mPeople, false);
mTowerDoc->mNameDB->Add(newName);