Browse Source

Merge branch 'ticket/38' of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata into ticket/38

tickets/38/38/7
ZarothYe 2 years ago
parent
commit
bff8203fbe
  1. 5
      Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp
  2. 10
      Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.cpp
  3. 51
      Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp

5
Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp

@ -587,16 +587,17 @@ std::wstring pyGUIControlListBox::GetElementW( UInt16 idx )
{ {
// if its a text element type then it should be safe to cast it to a pfGUIListText // if its a text element type then it should be safe to cast it to a pfGUIListText
pfGUIListText* letext = (pfGUIListText*)le; pfGUIListText* letext = (pfGUIListText*)le;
return letext->GetText(); return (letext->GetText() != nullptr) ? letext->GetText() : L"";
} }
else if ( le->GetType() == pfGUIListElement::kTreeRoot ) else if ( le->GetType() == pfGUIListElement::kTreeRoot )
{ {
pfGUIListTreeRoot* elroot = (pfGUIListTreeRoot*)le; pfGUIListTreeRoot* elroot = (pfGUIListTreeRoot*)le;
return elroot->GetTitle(); return (elroot->GetTitle() != nullptr) ? elroot->GetTitle() : L"";
} }
} }
} }
} }
return L""; return L"";
} }

10
Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.cpp

@ -176,16 +176,19 @@ void plKeyboardDevice::HandleKeyEvent(plOSMsg message, plKeyDef key, bool bKeyDo
if (key == KEY_SHIFT) if (key == KEY_SHIFT)
{ {
fShiftKeyDown = bKeyDown; fShiftKeyDown = bKeyDown;
// return;
} }
if (key == KEY_CTRL) if (key == KEY_CTRL)
{ {
fCtrlKeyDown = bKeyDown; fCtrlKeyDown = bKeyDown;
// return;
} }
if (key == KEY_CAPSLOCK) if (key == KEY_CAPSLOCK)
{ {
if (!bKeyRepeat) // Keyboards toggle the light on key-down, so I'm going with that.
if (bKeyDown && !bKeyRepeat)
{ {
fCapsLockLock = (GetKeyState(KEY_CAPSLOCK) & 1) == 1; fCapsLockLock = !fCapsLockLock;
plAvatarInputInterface::GetInstance()->ForceAlwaysRun(fCapsLockLock); plAvatarInputInterface::GetInstance()->ForceAlwaysRun(fCapsLockLock);
} }
} }
@ -205,8 +208,7 @@ void plKeyboardDevice::HandleWindowActivate(bool bActive, HWND hWnd)
{ {
if (bActive) if (bActive)
{ {
// Refresh the caps lock state fCtrlKeyDown = false;
HandleKeyEvent(KEYDOWN, KEY_CAPSLOCK, nil, false);
} }
else else
{ {

51
Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp

@ -504,25 +504,56 @@ bool plNetLinkingMgr::IProcessVaultNotifyMsg(plVaultNotifyMsg* msg)
return false; return false;
} }
if (cVaultLink != nil) if (cVaultLink != nil) {
{ // Verify that if the Age vault already exists that it matches the requested
// This is something that Cyan does... >.< // deferred link. If it doesn't exist, well, I hope you're happy with the result.
// It's very useful though...
VaultAgeLinkNode accLink(cVaultLink); VaultAgeLinkNode accLink(cVaultLink);
accLink.CopyTo(cur); if (RelVaultNode* rvnInfo = cVaultLink->GetChildNodeIncRef(plVault::kNodeType_AgeInfo, 1)) {
if (RelVaultNode* rvnInfo = cVaultLink->GetChildNodeIncRef(plVault::kNodeType_AgeInfo, 1)) plAgeInfoStruct dest;
{
VaultAgeInfoNode accInfo(rvnInfo); VaultAgeInfoNode accInfo(rvnInfo);
accInfo.CopyTo(cur->GetAgeInfo()); accInfo.CopyTo(&dest);
if (!dest.IsEqualTo(fDeferredLink->GetAgeLink()->GetAgeInfo())) {
hsLogEntry(
plNetClientMgr::GetInstance()->DebugMsg(
"Waiting for a deferred link to '%s' but got AgeInfo for '%s' instead.",
fDeferredLink->GetAgeLink()->AsStdString().c_str(),
dest.AsStdString().c_str()
);
);
rvnInfo->DecRef();
return false;
}
rvnInfo->DecRef(); rvnInfo->DecRef();
} }
// If we're still here, that means the links match. Set the vault copy as our current
// AgeLink and AgeInfo. Note this mainly copies the AgeInfo.
accLink.CopyTo(cur);
hsLogEntry(
plNetClientMgr::GetInstance()->DebugMsg(
"Performing deferred link to '%s'",
cur->AsStdString().c_str()
);
);
// Steals fDeferredLink
IDoLink(fDeferredLink); IDoLink(fDeferredLink);
fDeferredLink = nil; fDeferredLink = nil;
return true;
cVaultLink->DecRef(); cVaultLink->DecRef();
}
return true;
} else {
hsLogEntry(
plNetClientMgr::GetInstance()->ErrorMsg(
"Waiting for a deferred link to '%s' but got a garbage link?",
fDeferredLink->GetAgeLink()->AsStdString().c_str()
)
);
}
return false; return false;
} }

Loading…
Cancel
Save