feat: initialized template

This commit is contained in:
Sara 2025-06-23 19:48:13 +02:00
parent fdb9ad8de0
commit 37b3a63ae6
12 changed files with 48 additions and 31 deletions

12
.gitignore vendored
View file

@ -5,10 +5,16 @@
# When configure fails, SCons outputs these
config.log
.sconf_temp
.config
# build artefacts
.cache/
*.o
compile_commands.json
engine/.github
project/.godot
build/PROJECT.pck
build/PROJECT.x86_64
build/PROJECT.exe
build/authority.pck
build/authority.x86_64
build/authority.exe
build.zip

View file

@ -1,6 +1,6 @@
set export
BUILD_NAME := "change_me"
BUILD_NAME := "authority"
build: format
# Compiling Editor

View file

@ -1,15 +0,0 @@
#include "register_types.h"
#include "core/object/class_db.h"
void initialize_PROJECT_module(ModuleInitializationLevel p_level) {
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
return;
}
}
void uninitialize_PROJECT_module(ModuleInitializationLevel p_level) {
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
return;
}
}

View file

@ -1,9 +0,0 @@
#ifndef PROJECT_REGISTER_TYPES_H
#define PROJECT_REGISTER_TYPES_H
#include "modules/register_module_types.h"
void initialize_PROJECT_module(ModuleInitializationLevel p_level);
void uninitialize_PROJECT_module(ModuleInitializationLevel p_level);
#endif // !PROJECT_REGISTER_TYPES_H

Binary file not shown.

View file

@ -0,0 +1,26 @@
#include "register_types.h"
#include "authority/game_state.h"
#include "core/config/engine.h"
#include "core/object/class_db.h"
GameState *game_state{nullptr};
void initialize_authority_module(ModuleInitializationLevel p_level) {
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
return;
}
GDREGISTER_CLASS(GameState);
game_state = memnew(GameState);
Engine::get_singleton()->add_singleton(Engine::Singleton("GameState", GameState::get_singleton()));
}
void uninitialize_authority_module(ModuleInitializationLevel p_level) {
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
return;
}
if(game_state) {
memdelete(game_state);
}
}

View file

@ -0,0 +1,9 @@
#ifndef authority_REGISTER_TYPES_H
#define authority_REGISTER_TYPES_H
#include "modules/register_module_types.h"
void initialize_authority_module(ModuleInitializationLevel p_level);
void uninitialize_authority_module(ModuleInitializationLevel p_level);
#endif // !authority_REGISTER_TYPES_H

View file

@ -9,7 +9,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../build/PROJECT.x86_64"
export_path="../build/authority.x86_64"
patches=PackedStringArray()
encryption_include_filters=""
encryption_exclude_filters=""
@ -51,7 +51,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../build/PROJECT.exe"
export_path="../build/authority.exe"
patches=PackedStringArray()
encryption_include_filters=""
encryption_exclude_filters=""

View file

@ -10,6 +10,6 @@ config_version=5
[application]
config/name="PROJECT"
config/name="authority"
config/features=PackedStringArray("4.4", "Forward Plus")
config/icon="res://icon.svg"