Skip to content

Commit

Permalink
updated disclaimer, archive detection, clean up flags
Browse files Browse the repository at this point in the history
No more beeps, no more persistent warnings, no more insults, just a single silent disclaimer that also helps the user get started using games from their console.

Updated the archived format detection to add tar/gz, and updated the box to state that xenia does not support running archived games.
  • Loading branch information
JeBobs authored and Gliniak committed Jul 27, 2023
1 parent 2ab2a65 commit ef91193
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 27 deletions.
6 changes: 1 addition & 5 deletions src/xenia/app/emulator_window.cc
Expand Up @@ -850,11 +850,7 @@ void EmulatorWindow::OnKeyDown(ui::KeyEvent& e) {
} break;

case ui::VirtualKey::kF2: {
if (e.is_ctrl_pressed()) {
emulator()->ClearStickyPersistentFlags();
} else {
ShowBuildCommit();
}
ShowBuildCommit();
} break;

case ui::VirtualKey::kF9: {
Expand Down
44 changes: 26 additions & 18 deletions src/xenia/emulator.cc
Expand Up @@ -111,19 +111,28 @@ Emulator::Emulator(const std::filesystem::path& command_line,
paused_(false),
restoring_(false),
restore_fence_() {
// show the quickstart guide the first time they ever open the emulator
uint64_t persistent_flags = GetPersistentEmulatorFlags();
if (!(persistent_flags & EmulatorFlagQuickstartShown)) {
#if XE_PLATFORM_WIN32 == 1
if (MessageBoxW(nullptr, L"Xenia does not support or condone piracy in anyway shape or form\nDo you want to open the quickstart guide?", L"Xenia", MB_YESNO | MB_ICONQUESTION) == IDYES) {
#endif
LaunchWebBrowser(
"https://github.com/xenia-canary/xenia-canary/wiki/Quickstart#how-to-rip-games");
SetPersistentEmulatorFlags(persistent_flags | EmulatorFlagQuickstartShown);
#if XE_PLATFORM_WIN32 == 1
// Show a disclaimer that links to the quickstart
// guide the first time they ever open the emulator
uint64_t persistent_flags = GetPersistentEmulatorFlags();
if (!(persistent_flags & EmulatorFlagDisclaimerAcknowledged)) {
if ((MessageBoxW(
nullptr,
L"DISCLAIMER: Xenia is not for enabling illegal activity, and "
"support is unavailable for illegally obtained software.\n\n"
"Please respect this policy as no further reminders will be "
"given.\n\nThe quickstart guide explains how to use digital or "
"physical games from your Xbox 360 console.\n\nWould you like "
"to open it?",
L"Xenia", MB_YESNO | MB_ICONQUESTION) == IDYES)) {
LaunchWebBrowser(
"https://github.com/xenia-project/xenia/wiki/"
"Quickstart#how-to-rip-games");
}
#endif
SetPersistentEmulatorFlags(persistent_flags |
EmulatorFlagDisclaimerAcknowledged);
}
#endif
}

Emulator::~Emulator() {
Expand Down Expand Up @@ -310,8 +319,12 @@ const std::unique_ptr<vfs::Device> Emulator::CreateVfsDeviceBasedOnPath(
auto parent_path = path.parent_path();
return std::make_unique<vfs::HostPathDevice>(
mount_path, parent_path, !cvars::allow_game_relative_writes);
} else if (extension == ".7z" || extension == ".zip" || extension == ".rar") {
xe::FatalError(fmt::format("Xenia does not support running {} files.", extension));
} else if (extension == ".7z" || extension == ".zip" || extension == ".rar" ||
extension == ".tar" || extension == ".gz") {
xe::ShowSimpleMessageBox(
xe::SimpleMessageBoxType::Error,
fmt::format("Unsupported format!"
"Xenia does not support running software in an archived format."));
}
return std::make_unique<vfs::DiscImageDevice>(mount_path, path);
}
Expand All @@ -337,7 +350,7 @@ uint64_t Emulator::GetPersistentEmulatorFlags() {
}
return value;
#else
return EmulatorFlagQuickstartShown | EmulatorFlagIsoWarningAcknowledged;
return EmulatorFlagDisclaimerAcknowledged;
#endif
}
void Emulator::SetPersistentEmulatorFlags(uint64_t new_flags) {
Expand All @@ -358,11 +371,6 @@ void Emulator::SetPersistentEmulatorFlags(uint64_t new_flags) {
#endif
}

void Emulator::ClearStickyPersistentFlags() {
SetPersistentEmulatorFlags(GetPersistentEmulatorFlags() &
~EmulatorFlagIsoWarningSticky);
}

X_STATUS Emulator::MountPath(const std::filesystem::path& path,
const std::string_view mount_path) {
auto device = CreateVfsDeviceBasedOnPath(path, mount_path);
Expand Down
5 changes: 1 addition & 4 deletions src/xenia/emulator.h
Expand Up @@ -202,7 +202,6 @@ class Emulator {
void Pause();
void Resume();
bool is_paused() const { return paused_; }
void ClearStickyPersistentFlags();
bool SaveToFile(const std::filesystem::path& path);
bool RestoreFromFile(const std::filesystem::path& path);

Expand All @@ -222,9 +221,7 @@ class Emulator {

private:
enum : uint64_t {
EmulatorFlagQuickstartShown = 1ULL << 0,
EmulatorFlagIsoWarningAcknowledged = 1ULL << 1,
EmulatorFlagIsoWarningSticky = 1ULL<<2,
EmulatorFlagDisclaimerAcknowledged = 1ULL << 0
};
static uint64_t GetPersistentEmulatorFlags();
static void SetPersistentEmulatorFlags(uint64_t new_flags);
Expand Down

1 comment on commit ef91193

@DeadSpecimen
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was all it ever needed to be. I won't even touch on the beep as personally that seemed like rushed ignorance over malice. However, to openly insult people for not knowing how compressed files work and for not wanting to be talked down to with these incredibly disrespectful and inflammatory pop-ups (not to meantion the brazen hatred of these people in the code comments) was beyond unprofessional. I hope this never happens again and Xenia can come back and allow everyone to just enjoy playing games again. People/"noobs" can be annoying, I do IT so I understand that. But Jesus H Christ keep it to yourselves from now on.

Please sign in to comment.