You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Refactor version macros and fix related bugs
The previous logic with VERSION_MKSTRING was a bit unwieldy, so there were several places hardcoding their own variant of the version string, potentially with bugs (e.g. forgetting the patch number when defined). The new logic defines: - VERSION_BRANCH, the main 'major.minor' version (e.g. 3.1) - VERSION_NUMBER, which can be 'major.minor' or 'major.minor.patch', depending on whether the latter is defined (e.g. 3.1.4) - VERSION_FULL_CONFIG, which contains the version status (e.g. stable) and the module-specific suffix (e.g. mono) - VERSION_FULL_BUILD, same as above but with build/reference name (e.g. official, custom_build, mageia, etc.) Note: Slight change here, as the previous format had the build name *before* the module-specific suffix; now it's after - VERSION_FULL_NAME, same as before, so VERSION_FULL_BUILD prefixed with "Godot v" for readability Bugs fixed thanks to that: - Export templates version matching now properly takes VERSION_PATCH into account by relying on VERSION_FULL_CONFIG. - ClassDB hash no longer takes the build name into account, but limits itself to VERSION_FULL_CONFIG (build name is cosmetic, not relevant for the API hash). - Docs XML no longer hardcode the VERSION_STATUS, this was annoying. - Small cleanup in Windows .rc file thanks to new macros.
This commit is contained in:
@@ -30,11 +30,10 @@
|
||||
|
||||
#include "asset_library_editor_plugin.h"
|
||||
|
||||
#include "core/io/json.h"
|
||||
#include "core/version.h"
|
||||
#include "editor_node.h"
|
||||
#include "editor_settings.h"
|
||||
#include "io/json.h"
|
||||
|
||||
#include "version_generated.gen.h"
|
||||
|
||||
void EditorAssetLibraryItem::configure(const String &p_title, int p_asset_id, const String &p_category, int p_category_id, const String &p_author, int p_author_id, int p_rating, const String &p_cost) {
|
||||
|
||||
@@ -877,7 +876,8 @@ void EditorAssetLibrary::_search(int p_page) {
|
||||
}
|
||||
args += String() + "sort=" + sort_key[sort->get_selected()];
|
||||
|
||||
args += "&godot_version=" + itos(VERSION_MAJOR) + "." + itos(VERSION_MINOR);
|
||||
// We use the "branch" version, i.e. major.minor, as patch releases should be compatible
|
||||
args += "&godot_version=" + String(VERSION_BRANCH);
|
||||
|
||||
String support_list;
|
||||
for (int i = 0; i < SUPPORT_MAX; i++) {
|
||||
|
||||
Reference in New Issue
Block a user