Fixed button click state not resetting bug #398

Merged
maverickdgg merged 4 commits from SP3-20-UI-System into main 2023-03-05 14:46:18 +08:00
3 changed files with 15 additions and 3 deletions
Showing only changes of commit 76e794a543 - Show all commits

View File

@ -272,6 +272,13 @@ namespace SHADE
if (arm->isActive == true)
{
camera.offset = arm->GetOffset();
SHVec3 tOffset = arm->GetTargetOffset();
tOffset = SHVec3::RotateY(tOffset, SHMath::DegreesToRadians(arm->GetYaw()));
if (arm->lookAtCameraOrigin)
CameraLookAt(camera, camera.position + arm->GetTargetOffset());

View File

@ -308,7 +308,7 @@ namespace SHADE
const bool CHANGED = ImGui::InputText("##", &buffer[0], TEXT_FIELD_MAX_LENGTH);
if (CHANGED)
{
value = std::string(buffer.data(), buffer.data() + TEXT_FIELD_MAX_LENGTH);
value = std::string(buffer.data(), buffer.data() + std::strlen(buffer.data()));
}
return CHANGED;
}

View File

@ -91,12 +91,17 @@ namespace SHADE
{
if (str == nullptr)
return "";
return msclr::interop::marshal_as<std::string>(str);
std::string s = msclr::interop::marshal_as<std::string>(str);
s.substr(0, str->Length);
return s;
}
System::String^ Convert::ToCLI(const std::string& str)
{
return msclr::interop::marshal_as<System::String^>(str);
if (str.empty())
return "";
return msclr::interop::marshal_as<System::String^>(str)->Substring(0, str.length());
}
/*---------------------------------------------------------------------------------*/