瀏覽代碼

UI: Support platform-specific WhatsNew entries

derrod 2 年之前
父節點
當前提交
11e5afa2b2
共有 1 個文件被更改,包括 14 次插入0 次删除
  1. 14 0
      UI/window-basic-main.cpp

+ 14 - 0
UI/window-basic-main.cpp

@@ -2197,6 +2197,20 @@ void OBSBasic::ReceivedIntroJson(const QString &text)
 	/* check to see if there's an info page for this version */
 	const Json::array &items = json.array_items();
 	for (const Json &item : items) {
+		if (item["os"].is_object()) {
+			Json::object platforms = item["os"].object_items();
+#ifdef _WIN32
+			if (!platforms["windows"].bool_value())
+				continue;
+#elif defined(__APPLE__)
+			if (!platforms["macos"].bool_value())
+				continue;
+#else
+			if (!platforms["linux"].bool_value())
+				continue;
+#endif
+		}
+
 		const std::string &version = item["version"].string_value();
 		const std::string &url = item["url"].string_value();
 		int increment = item["increment"].int_value();