Compare commits

..

No commits in common. "fd3306b175bff5b8d73a1f6b39ce919a9b3ad6e1" and "592fd2ba3aae5a7ded8aa9ee72e680c087ff7827" have entirely different histories.

4 changed files with 10 additions and 9 deletions

View file

@ -18,7 +18,7 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(SAVETOOL_PROJECT_VERSION 1.3.1)
set(SAVETOOL_PROJECT_VERSION 1.3.0)
find_package(Corrade REQUIRED Main Containers Utility Interconnect)
find_package(Magnum REQUIRED GL Sdl2Application)

View file

@ -69,7 +69,7 @@ auto MassManager::importMass(Containers::StringView staged_fn, Int hangar) -> bo
return false;
}
auto it = _stagedMasses.find(Containers::String::nullTerminatedView(staged_fn));
auto it = _stagedMasses.find(staged_fn);
if(it == _stagedMasses.end()) {
_lastError = "Couldn't find "_s + staged_fn + " in the staged M.A.S.S.es."_s;

View file

@ -208,12 +208,13 @@ void SaveTool::handleFileAction(efsw::WatchID watch_id,
}
event.user.code = action;
event.user.data1 = Containers::String{Containers::AllocatedInit, filename.c_str()}.release();
event.user.data1 = Containers::String{filename}.release();
if(action == efsw::Actions::Moved) {
event.user.data2 = Containers::String{old_filename}.release();
}
SDL_PushEvent(&event);
return;
}
void SaveTool::drawEvent() {
@ -323,7 +324,7 @@ void SaveTool::updateCheckEvent(SDL_Event& event) {
start_point++;
}
auto components = Containers::StringView{str.data() + start_point}.split('.');
auto components = Containers::StringView{str.data() + start_point, strlen(str.data() + start_point)}.split('.');
major = std::strtol(components[0].data(), nullptr, 10);
minor = std::strtol(components[1].data(), nullptr, 10);
@ -352,7 +353,7 @@ void SaveTool::updateCheckEvent(SDL_Event& event) {
continue;
}
Version latest_ver{release["tag_name"].get<std::string>().c_str()};
Version latest_ver{to_string(release["tag_name"])};
if(latest_ver > current_ver || (latest_ver == current_ver && Utility::String::endsWith(SAVETOOL_VERSION, "-pre"))) {
_queue.addToast(Toast::Type::Warning, "Your version is out of date.\nCheck the settings for more information."_s,

View file

@ -475,14 +475,14 @@ void SaveTool::drawMassManager() {
}
if((_unsafeMode || _gameState == GameState::NotRunning) && ImGui::BeginDragDropTarget()) {
if(const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("StagedMass")) {
if(payload->DataSize != sizeof(Containers::String)) {
if(payload->DataSize != sizeof(std::string)) {
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal error",
"payload->DataSize != sizeof(Containers::String) in SaveTool::drawMassManager()",
"payload->DataSize != sizeof(std::string) in SaveTool::drawMassManager()",
window());
exit(EXIT_FAILURE);
}
Containers::StringView file = *static_cast<Containers::String*>(payload->Data);
std::string file = *(static_cast<std::string*>(payload->Data));
if(!_massManager->importMass(file, i)) {
_queue.addToast(Toast::Type::Error, _massManager->lastError());
@ -584,7 +584,7 @@ void SaveTool::drawMassManager() {
drawTooltip(staged_formatted.data());
}
if(ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceNoHoldToOpenOthers)) {
ImGui::SetDragDropPayload("StagedMass", &(pair.first), sizeof(Containers::String));
ImGui::SetDragDropPayload("StagedMass", &(pair.first), sizeof(std::string));
ImGui::Text("%s - Staged", pair.second.data());