Skip to content

Xbox Cloud Gaming app for PS5 Homebrew

C

Search: giveaways count as sales, only free-to-play is left out

Rafael Abud Ferreira205418229928
diff --git a/src/app/cli_main.cpp b/src/app/cli_main.cpp
index be65060..8c1307e 100644
--- a/src/app/cli_main.cpp
+++ b/src/app/cli_main.cpp
@@ -621,7 +621,8 @@ int main(int argc, char** argv) {
{"BUY1", {"R$ 199,99", "", 199.99, 199.99}},
{"BUY2", {"GR\xC3\x81TIS", "", 0, 0}},
{"BUY3", {"R$ 1.299,90", "", 1299.9, 1299.9}},
- {"BUY4", {"R$ 20,00", "R$ 40,00", 20, 40}}});
+ {"BUY4", {"R$ 20,00", "R$ 40,00", 20, 40}},
+ {"BUY5", {"GR\xC3\x81TIS", "R$ 99,90", 0, 99.9}}}); // a giveaway
app.showHome();
auto press = [&](auto set, int times = 1) {
for (int i = 0; i < times; ++i) {
diff --git a/src/ui/app_ui.cpp b/src/ui/app_ui.cpp
index e41fc85..9d64169 100644
--- a/src/ui/app_ui.cpp
+++ b/src/ui/app_ui.cpp
@@ -488,11 +488,15 @@ void AppUi::runSearch() {
auto price = prices_.find(t.productId);
bool priced = price != prices_.end();
if (tab_ == Tab::Library) {
- bool free = t.freeInStore || (t.purchasable && priced && price->second.list < 0.005);
- if (filterFree_ && !free) continue;
- // Free games have their own filter: the price orders leave them
- // out (FREE would top "Lowest price"), unless Free is on too.
- if ((filterCheapest_ || filterSale_) && free && !filterFree_) continue;
+ // Free-to-play: free in the store and no regular price. A paid
+ // game given away (price 0 now, regular price above 0) is a
+ // sale, not free-to-play.
+ bool zeroNow = t.purchasable && priced && price->second.list < 0.005;
+ bool freeToPlay = t.freeInStore || (zeroNow && price->second.msrp < 0.005);
+ if (filterFree_ && !freeToPlay && !zeroNow) continue; // Free: both
+ // Free-to-play games have their own filter: the price orders
+ // leave them out, unless Free is on too. Giveaways stay (first).
+ if ((filterCheapest_ || filterSale_) && freeToPlay && !filterFree_) continue;
// Price filters look at games to buy only.
if ((filterCheapest_ || filterSale_) && !t.purchasable) continue;
if (filterSale_ && !(priced && price->second.msrp > price->second.list + 0.005)) continue;