Grab everything from the 2d version.

This commit is contained in:
Relintai 2020-07-11 23:36:22 +02:00
parent ca464def38
commit cc1c3114e7
572 changed files with 11177 additions and 4376 deletions

14
.gitignore vendored
View File

@ -1,16 +1,18 @@
./engine/*
./modules/*
engine
modules
modules/*
ignore/*
*.d
*.o
*.meta
game/.import/**
game/.prop_tool_temp/**
.sconsign.dblite
.DS_Store
.vs/*
.kdev4/*
.vscode/*
TestRWTextures
@ -18,7 +20,7 @@ _build/*
_binaries/*
game/android/build/*
#ignore everything in the Engine Directory
engine/*
*.blend1
.dir-locals.el
build.config

View File

@ -1,17 +0,0 @@
cd ./engine
call scons -j6 platform=android target=release_debug android_arch=armv7 entities_2d=yes
call scons -j6 platform=android target=release_debug android_arch=arm64v8 entities_2d=yes
call scons -j6 platform=android target=release_debug android_arch=x86 entities_2d=yes
cd ./platform/android/java
rem call .\gradlew.bat build
call .\gradlew.bat generateGodotTemplates
cd ..
cd ..
cd ..
cd ..

View File

@ -1,15 +0,0 @@
cd ./engine
call scons -j6 platform=android target=release android_arch=armv7 entities_2d=yes
call scons -j6 platform=android target=release android_arch=arm64v8 entities_2d=yes
call scons -j6 platform=android target=release android_arch=x86 entities_2d=yes
cd ./platform/android/java
call .\gradlew.bat build
cd ..
cd ..
cd ..
cd ..

View File

@ -1,6 +0,0 @@
cd ./engine
call scons -j2 platform=javascript tools=no target=release_debug entities_2d=yes
cd ..

View File

@ -1,15 +0,0 @@
rem call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
cd ./Engine
rem scons -j6 platform=windows
if not defined DevEnvDir (
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
)
call scons -j6 platform=windows target=release tools=no entities_2d=yes
cd ..

View File

@ -1,34 +0,0 @@
rem call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
cd ./engine
rem scons -j6 platform=windows
if not defined DevEnvDir (
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
)
call scons -j6 platform=windows target=release_debug entities_2d=yes javascript_eval=false module_arkit_enabled=no module_assimp_enabled=no module_csg_enabled=no module_gdnative_enabled=no module_opus_enabled=no module_webp_enabled=no module_webm_enabled=no module_visual_script_enabled=no module_xatlas_unwrap_enabled=no module_theora_enabled=no module_vhacd_enabled=no module_tinyexr_enabled=no module_squish_enabled=no module_gridmap_enabled=no
cd ..
rem use_lto=yes
rem module_regex_enabled=no
rem javascript_eval=false
rem module_hdr_enabled=no
rem module_jpg_enabled=no
rem module_jsonrpc_enabled=no
rem module_pvr_enabled=no
rem module_cvtt_enabled?
rem module_dds_enabled?

View File

@ -1,15 +0,0 @@
rem call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
cd ./engine
rem scons -j6 platform=windows
if not defined DevEnvDir (
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
)
call scons -j6 platform=windows target=release_debug entities_2d=yes
cd ..

View File

@ -1,15 +0,0 @@
rem call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
cd ./engine
rem scons -j6 platform=windows
if not defined DevEnvDir (
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
)
call scons -j3 platform=windows target=release_debug entities_2d=yes
cd ..

View File

@ -1,15 +0,0 @@
rem call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
cd ./engine
rem scons -j6 platform=windows
if not defined DevEnvDir (
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
)
call scons -j6 platform=windows target=debug entities_2d=yes
cd ..

View File

@ -1,11 +0,0 @@
rem call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
cd ./engine
rem scons -j6 platform=windows
call scons -j6 platform=windows target=release_debug entities_2d=yes use_mingw=yes
cd ..

View File

@ -1,16 +0,0 @@
rem call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
cd ./Engine
rem scons -j6 platform=windows
if not defined DevEnvDir (
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
)
call scons -j6 platform=windows target=release_debug tools=no entities_2d=yes
cd ..

2
HEADS
View File

@ -1 +1 @@
{"engine": "56d44aaac96747d2311b11702598c2e65551f411", "world_generator": "58e38c07bd798a44232ecdfe02db038e3c434239", "entity_spell_system": "e9a7a92fb289ba1927a1b74c27eeb4d776e7a4a1", "ui_extensions": "271dcf89e9afe5cb6350de2f2433c8ebf8aba785", "texture_packer": "604c330188e220c15d10ea5bd545a6fc5aab0132", "fastnoise": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e", "ess_data": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}
{"engine": {"3.2": "3f57cb12b435f44d60ab813ba824b8bf7f44d5b3"}, "world_generator": {"master": "9a4f9f9809cb4da6d0196a9b37ea480e3cd0c400"}, "entity_spell_system": {"master": "f343482bf6e2346c91d5a57603f67e3a7fbd684f"}, "ui_extensions": {"master": "6fe4f69fea8d71043b08d959b8085404c9c4fe47"}, "texture_packer": {"master": "2993ed34f34cfa6a5e61b7913380231e9c55eda6"}, "fastnoise": {"master": "d0e3f1c759332cf0d9a5d7e0e71d0b0278310651"}, "thread_pool": {"master": "93320fe864128d706bcc47fc7ed0731e6e9bcf69"}}

View File

@ -1,4 +1,4 @@
Copyright (c) 2019 Péter Magyar
Copyright (c) 2019-2020 Péter Magyar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

20
Makefile Normal file
View File

@ -0,0 +1,20 @@
all:
scons bels -j5
e:
scons belsE -j5
t:
scons belsT -j5
v:
scons belsV -j5
W:
scons belsW -j5
p:
scons belsP -j5
m:
scons belsM -j5

173
README.md
View File

@ -1 +1,172 @@
# broken_seals_roguelike
# Broken Seals
A 3D third person RPG. With both multiplayer, and singleplayer capabilities.
The main gameplay-loop goal is to create an experience with enough complexity and depth, that can rival the more old-school MMO- and action rpgs, because nowadays I feel like that is something that got lost.
I want the game to run on every platform, but the game design is PC first. From the testing I've done this is not going to be an issue.
### In order to open the game project in Godot, you need a custom built Godot editor! [See here.](#editing-the-game)
Screenshot:
![Broken Seals](pictures/screen.jpg)
## Editing the game
In order for you to open the game in the editor you will need a custom built version, with a few engine modules built in,
and unfortunately for now, you will need to build it yourself. (Binary releases will be available eventually!)
But don't worry, Godot is surpisingly easy and hassle free to compile! [See here.](#compiling)
After you have the engine with the required modules, you can go ahead, and just open the project inside the `game` folder.
Usually after the initial import it will need a restart, however everything should work after that.
## The required engine modules
These are the required engine modules, they are listed here for completeness`s sake, the project's setup script will install these for you automatically! See the [Compiling](#compiling) section.
https://github.com/Relintai/world_generator.git \
https://github.com/Relintai/entity_spell_system.git \
https://github.com/Relintai/ui_extensions.git \
https://github.com/Relintai/voxelman.git \
https://github.com/Relintai/texture_packer.git \
https://github.com/Relintai/godot_fastnoise.git \
https://github.com/Relintai/mesh_data_resource.git \
https://github.com/Relintai/procedural_animations.git \
https://github.com/Relintai/props.git \
https://github.com/Relintai/mesh_utils.git \
https://github.com/Relintai/broken_seals_module.git \
https://github.com/Relintai/thread_pool.git
## Compiling
First make sure, that you have everything installed to be able to compile the engine. See: See the [official docs for compiling Godot](https://docs.godotengine.org/en/latest/development/compiling/index.html) for more info.
Now let's clone this repository:
``` git clone https://github.com/Relintai/broken_seals ```
cd into the new folder:
``` cd broken_seals ```
Now let's run the project's setup script, by calling scons without arguments.
``` scons ```
This will clone and setup the engine, and all of the required modules into a new `engine` folder inside the project, using http.
(If you want to use the github's ssh links append `repository_type=ssh` like ``` scons repository_type=ssh ```)
Once it is done you can compile the engine, either by going into the engine folder and following the
[official docs](https://docs.godotengine.org/en/latest/development/compiling/index.html), or by using [build words](#build-words) without changing directories.
Once the build finishes you can find the editor executable inside the `./engine/bin/` folder, but you can also run it using the provided `editor.sh`,
or `editor.bat` (These will create a copy, so you can compile while the editor is running).
### Build words
The project's setup script contains support for "build words". These can be used from the root of this project.
For example to build the editor for windows with 4 threads you can use:
``` scons bew -j4 ```
The first argument must start with b (build), then it needs to be followed by a few abbreviations (the order does not matters)
The rest of the arguments will be passed directly to godot's scons script.
#### Editor
Append `e` to build with `tools=yes` a.k.a. the editor.
``` scons bew -j4 ```
if you omit `e`, the system will build the export template for you. For example:
``` scons bw -j4 ```
This will be the `release_debug` windows export template.
#### Platform abbreviations
`l`: linux \
`w`: windows \
`a`: android \
`j`: Javascript \
`i`: iphone (Not yet finished, use `build_ios.sh`, and `build_ios_release.sh`) \
Mac OSX: Not yet finished, use `build_osx.sh`
#### Target abbreviations
By default the system builds in release_debug.
Append `d` for debug, or `r` for release.
``` scons bewd -j4 ```
build editor windows debug
``` scons bwr -j4 ```
build windows release (this will build the windows release export template)
#### Shared modules
Note: This only works on linux!
append `s` to the build string.
Optionally you can also make the build system only build a target module, by appending one of these:
`E`: Entity Spell System \
`T`: Texture Packer \
`V`: Voxelman \
`W`: World Generator \
`P`: Procedural Animations
Example:
``` scons belsE -j4 ```
build editor linux shared (Entity Spell System) with 4 threads
Note: to easily run the editor you can use the `editor.sh` or `editor.bat` in the root of the project.
#### Other
Append `v` to pass the `vsproj=yes` parameter to the build script. This will generate Visual Studio project files.
#### Scons cache, and sdk locations
In order to use scons cache and to tell the build system where some of the required sdks are located you usually
have to use environment variables. Most of the time you might just want to add them globally,
howewer this is sometimes unfeasible (e.g. you don't have administrator access, or you just want to have
multiple sdk versions installed).
In order to solve this a build config file was added.
If you want to use the config simply rename the provided `build.config.example` to `build.config`, and customize
the settings inside.
## Pulling upstream changes
First pull the changes by calling
``` git pull orgin master ```
Then just run `scons`, to will update the modules.
## Upgrading the modules
Note: this is how to update the HEADS file. Normally you don't need to do this.
If you want to update the modules, and the engine to the latest, you can use (`action=update`):
``` scons a=u ```
You can also update different targets: `all`, `engine`, `modules`, `all_addons`, `addons`, `third_party_addons`
For example to update the engine to the latest: ``` scons a=u target=engine ```

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# Copyright (c) 2019 Péter Magyar
# Copyright (c) 2019-2020 Péter Magyar
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ -27,12 +27,25 @@ import os
import subprocess
import json
import shutil
import traceback
repository_index = 0
module_clone_path = '/modules/'
clone_command = 'git clone {0} {1}'
engine_repository = [ ['https://github.com/godotengine/godot.git', 'https://github.com/godotengine/godot.git'], 'engine', '' ]
visual_studio_call_vcvarsall = False
visual_studio_vcvarsall_path = 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat'
visual_studio_arch = 'amd64'
exports = {
'global': [],
'linux': [],
'windows': [],
'android': [],
'javascript': [],
}
engine_repository = [ ['https://github.com/godotengine/godot.git', 'git@github.com:godotengine/godot.git'], 'engine', '' ]
module_repositories = [
[ ['https://github.com/Relintai/world_generator.git', 'git@github.com:Relintai/world_generator.git'], 'world_generator', '' ],
@ -40,10 +53,10 @@ module_repositories = [
[ ['https://github.com/Relintai/ui_extensions.git', 'git@github.com:Relintai/ui_extensions.git'], 'ui_extensions', '' ],
[ ['https://github.com/Relintai/texture_packer.git', 'git@github.com:Relintai/texture_packer.git'], 'texture_packer', '' ],
[ ['https://github.com/Relintai/godot_fastnoise.git', 'git@github.com:Relintai/godot_fastnoise.git'], 'fastnoise', '' ],
[ ['https://github.com/Relintai/thread_pool.git', 'git@github.com:Relintai/thread_pool.git'], 'thread_pool', '' ],
]
addon_repositories = [
[ ['https://github.com/Relintai/ess_data.git', 'git@github.com:Relintai/ess_data.git' ], 'ess_data', '' ],
]
third_party_addon_repositories = [
@ -51,6 +64,31 @@ third_party_addon_repositories = [
target_commits = {}
godot_branch = '3.2'
def onerror(func, path, exc_info):
"""
https://stackoverflow.com/questions/2656322/shutil-rmtree-fails-on-windows-with-access-is-denied
Because Windows.
Error handler for ``shutil.rmtree``.
If the error is due to an access error (read only file)
it attempts to add write permission and then retries.
If the error is for another reason it re-raises the error.
Usage : ``shutil.rmtree(path, onerror=onerror)``
"""
import stat
if not os.access(path, os.W_OK):
# Is the error an access error ?
os.chmod(path, stat.S_IWUSR)
func(path)
else:
raise
def load_target_commits_array():
global target_commits
@ -64,7 +102,7 @@ def save_target_commits_array():
with open('./HEADS', 'w') as outfile:
json.dump(target_commits, outfile)
def update_repository(data, clone_path):
def update_repository(data, clone_path, branch = 'master'):
cwd = os.getcwd()
full_path = cwd + clone_path + data[1] + '/'
@ -76,18 +114,26 @@ def update_repository(data, clone_path):
os.chdir(full_path)
subprocess.call('git reset', shell=True)
subprocess.call('git reset --hard', shell=True)
subprocess.call('git pull origin master', shell=True)
subprocess.call('git checkout master', shell=True)
subprocess.call('git clean -f -d', shell=True)
subprocess.call('git checkout -B ' + branch + ' origin/' + branch, shell=True)
subprocess.call('git reset', shell=True)
subprocess.call('git reset --hard', shell=True)
subprocess.call('git clean -f -d', shell=True)
subprocess.call('git pull origin ' + branch, shell=True)
process = subprocess.Popen('git rev-parse HEAD', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = process.communicate()[0].decode().strip()
target_commits[data[1]] = output
if data[1] not in target_commits:
target_commits[data[1]] = {}
target_commits[data[1]][branch] = output
os.chdir(cwd)
def setup_repository(data, clone_path):
def setup_repository(data, clone_path, branch = 'master'):
cwd = os.getcwd()
full_path = cwd + clone_path + data[1] + '/'
@ -99,15 +145,20 @@ def setup_repository(data, clone_path):
os.chdir(full_path)
subprocess.call('git reset', shell=True)
subprocess.call('git reset --hard', shell=True)
subprocess.call('git clean -f -d', shell=True)
subprocess.call('git checkout -B ' + branch + ' origin/' + branch, shell=True)
subprocess.call('git pull origin ' + branch, shell=True)
subprocess.call('git reset', shell=True)
subprocess.call('git reset --hard', shell=True)
subprocess.call('git pull origin master', shell=True)
target = 'master'
if data[1] in target_commits:
target = target_commits[data[1]]
target = target_commits[data[1]][branch]
subprocess.call('git checkout ' + target, shell=True)
subprocess.call('git checkout -B ' + branch + ' ' + target, shell=True)
subprocess.call('git clean -f -d', shell=True)
subprocess.call('git reset', shell=True)
subprocess.call('git reset --hard', shell=True)
os.chdir(cwd)
@ -122,7 +173,7 @@ def copytree(src, dst):
if os.path.isdir(sp):
if os.path.isdir(dp):
shutil.rmtree(dp)
shutil.rmtree(dp, onerror=onerror)
shutil.copytree(sp, dp)
else:
@ -132,7 +183,7 @@ def copytree(src, dst):
shutil.copy2(sp, dp)
def update_engine():
update_repository(engine_repository, '/')
update_repository(engine_repository, '/', godot_branch)
def update_modules():
for rep in module_repositories:
@ -159,7 +210,7 @@ def update_all():
def setup_engine():
setup_repository(engine_repository, '/')
setup_repository(engine_repository, '/', godot_branch)
def setup_modules():
for rep in module_repositories:
@ -182,7 +233,227 @@ def setup_all():
setup_addons()
setup_addons_third_party_addons()
def format_path(path):
if 'win' in sys.platform:
path = path.replace('/', '\\')
path = path.replace('~', '%userprofile%')
return path
def get_exports_for(platform):
export_command = 'export '
command_separator = ';'
if 'win' in sys.platform:
command_separator = '&'
export_command = 'set '
command = ''
for p in exports[platform]:
command += export_command + p + command_separator
return command
def parse_config():
global visual_studio_vcvarsall_path
global visual_studio_arch
global visual_studio_call_vcvarsall
global exports
if not os.path.isfile('build.config'):
return
with open('build.config', 'r') as f:
for line in f:
ls = line.strip()
if ls == '' or ls.startswith('#'):
continue
words = line.split()
if (len(words) < 2):
print('This build.config line is malformed, and got ignored: ' + ls)
continue
if words[0] == 'visual_studio_vcvarsall_path':
visual_studio_vcvarsall_path = format_path(ls[29:])
elif words[0] == 'visual_studio_arch':
visual_studio_arch = format_path(ls[19:])
elif words[0] == 'visual_studio_call_vcvarsall':
visual_studio_call_vcvarsall = words[1].lower() in [ 'true', '1', 't', 'y', 'yes' ]
elif words[0] == 'export':
if (len(words) < 3) or not words[1] in exports:
print('This build.config line is malformed, and got ignored: ' + ls)
continue
export_path = format_path(ls[8 + len(words[1]):])
exports[words[1]].append(export_path)
parse_config()
env = Environment()
if len(sys.argv) > 1:
arg = sys.argv[1]
if arg[0] == 'b':
build_string = get_exports_for('global') + 'scons '
build_string += 'tools='
if 'e' in arg:
build_string += 'yes'
else:
build_string += 'no'
build_string += ' '
build_string += 'target='
if 'r' in arg:
build_string += 'release'
elif 'd' in arg:
build_string += 'debug'
else:
build_string += 'release_debug'
build_string += ' '
build_string += 'custom_modules_shared='
if 's' in arg:
build_string += 'yes'
else:
build_string += 'no'
build_string += ' '
if 'm' in arg:
build_string += 'use_mingw=yes'
else:
if 'win' in sys.platform and visual_studio_call_vcvarsall:
build_string = 'call "{0}" {1}&'.format(visual_studio_vcvarsall_path, visual_studio_arch) + build_string
if 'o' in arg:
build_string += 'use_llvm=yes'
if 'v' in arg:
build_string += 'vsproj=yes'
for i in range(2, len(sys.argv)):
build_string += ' ' + sys.argv[i] + ' '
target = ' '
if 'E' in arg:
target += 'bin/libess.x11.opt.tools.64.so'
elif 'T' in arg:
target += 'bin/libtexture_packer.x11.opt.tools.64.so'
elif 'V' in arg:
target += 'bin/libvoxelman.x11.opt.tools.64.so'
elif 'W' in arg:
target += 'bin/libworld_generator.x11.opt.tools.64.so'
elif 'P' in arg:
target += 'bin/libprocedural_animations.x11.opt.tools.64.so'
cwd = os.getcwd()
full_path = cwd + '/engine/'
if not os.path.isdir(full_path):
print('engine directory doesnt exists.')
exit()
os.chdir(full_path)
if 'l' in arg:
build_string += 'platform=x11'
build_string = get_exports_for('linux') + build_string + target
print('Running command: ' + build_string)
subprocess.call(build_string, shell=True)
elif 'w' in arg:
build_string += 'platform=windows'
build_string = get_exports_for('windows') + build_string
print('Running command: ' + build_string)
subprocess.call(build_string, shell=True)
elif 'a' in arg:
build_string += 'platform=android'
build_string = get_exports_for('android') + build_string
print('Running command: ' + build_string + ' android_arch=armv7')
subprocess.call(build_string + ' android_arch=armv7', shell=True)
print('Running command: ' + build_string + ' android_arch=arm64v8')
subprocess.call(build_string + ' android_arch=arm64v8', shell=True)
print('Running command: ' + build_string + ' android_arch=x86')
subprocess.call(build_string + ' android_arch=x86', shell=True)
os.chdir(full_path + 'platform/android/java/')
print('Running command: ' + get_exports_for('global') + get_exports_for('android') + './gradlew generateGodotTemplates')
subprocess.call(get_exports_for('global') + get_exports_for('android') + './gradlew generateGodotTemplates', shell=True)
elif 'j' in arg:
build_string += 'platform=javascript'
build_string = get_exports_for('javascript') + build_string
print('Running command: ' + build_string)
subprocess.call(build_string, shell=True)
elif 'i' in arg:
build_string += 'platform=iphone'
subprocess.call(build_string + ' arch=arm', shell=True)
subprocess.call(build_string + ' arch=arm64', shell=True)
#subprocess.call('lipo -create bin/libgodot.iphone.{0}.arm.a bin/libgodot.iphone.{0}.arm64.a -output bin/libgodot.iphone.{1}.fat.a'.fomat(), shell=True)
#lipo -create bin/libgodot.iphone.opt.debug.arm.a bin/libgodot.iphone.opt.debug.arm64.a -output bin/libgodot.iphone.debug.fat.a
#rm bin/ios_xcode/libgodot.iphone.debug.fat.a
#cp bin/libgodot.iphone.debug.fat.a bin/ios_xcode/libgodot.iphone.debug.fat.a
#lipo -create bin/libgodot.iphone.opt.arm.a bin/libgodot.iphone.opt.arm64.a -output bin/libgodot.iphone.release.fat.a
#rm bin/ios_xcode/libgodot.iphone.release.fat.a
#cp bin/libgodot.iphone.release.fat.a bin/ios_xcode/libgodot.iphone.release.fat.a
subprocess.call('rm bin/iphone.zip', shell=True)
#cd bin/ios_xcode
subprocess.call(build_string + ' arch=arm64', shell=True)
subprocess.call('zip -r -X ../iphone.zip .', shell=True)
else:
print('No platform specified')
exit()
exit()
elif arg[0] == 'p':
if arg == 'p':
#print("Applies a patch. Append c for the compilation database patch. For example: pc")
print("Applies a patch. No Patches right now.")
exit()
cwd = os.getcwd()
full_path = cwd + '/engine/'
if not os.path.isdir(full_path):
print('engine directory doesnt exists.')
exit()
os.chdir(full_path)
#apply the patch to just the working directory, without creating a commit
#if 'c' in arg:
# subprocess.call('git apply --index ../patches/compilation_db.patch', shell=True)
#unstage all files
subprocess.call('git reset', shell=True)
exit()
opts = Variables(args=ARGUMENTS)
opts.Add('a', 'What to do', '')
@ -213,8 +484,10 @@ if env['t']:
if not os.path.isdir('./modules'):
os.mkdir('./modules')
if 'm' in action:
godot_branch = 'master'
if action == 'setup' or action == 's':
if 'setup' in action or action[0] == 's':
if target == 'all':
setup_all()
elif target == 'engine':
@ -228,7 +501,7 @@ if action == 'setup' or action == 's':
setup_addons()
elif target == 'third_party_addons':
setup_addons_third_party_addons()
elif action == 'update' or action == 'u':
elif 'update' in action or action[0] == 'u':
if target == 'all':
update_all()
elif target == 'engine':

View File

@ -1,8 +0,0 @@
rem call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd6
cd ./engine
rem scons -j6 platform=windows
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 && scons -j6 p=windows target=release_debug vsproj=yes voxel_mem_tools=no entities_2d=yes entity_mem_tools=no

44
build.config.example Normal file
View File

@ -0,0 +1,44 @@
# Copyright (c) 2019-2020 Péter Magyar
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Rename this file to build.config to use it
# Lines starting with # are comments. (Only works at the start of the line!)
# Note:
# ~ will be converted to %userprofile% on windows
# / will be converted to \ on windows
# so you don't have to worry about it
# Visual studio related setup:
visual_studio_call_vcvarsall True
visual_studio_vcvarsall_path C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build/vcvarsall.bat
visual_studio_arch amd64
# export related setup
# available export targets: global, linux, windows, android, javascript
export global SCONS_CACHE=~/.scons_cache
export global SCONS_CACHE_LIMIT=5000
export android ANDROID_NDK_ROOT=~/SDKs/Android/NDK/android-ndk-r20b
export android ANDROID_NDK_HOME=~/SDKs/Android/NDK/android-ndk-r20b
export android ANDROID_HOME=~/SDKs/Android/SDK

View File

@ -1,9 +0,0 @@
start "Android templates" /wait cmd /c call "Build_Android_Templates.bat" ^> 01.txt
start "Android templates release" /wait cmd /c call "Build_Android_Templates_Release.bat" ^> 02.txt
start "JS" /wait cmd /c call "Build_JavaScript.bat" ^> 03.txt
start "JS Release" /wait cmd /c call "build_javascript_release.bat" ^> 04.txt
start "Windows" /wait cmd /c call "Build_Windows.bat" ^> 05.txt
start "Window Templates" /wait cmd /c call "Build_Windows_Templates.bat" ^> 06.txt
start "Window Templates Release" /wait cmd /c call "Build_WIndows_Templates_rel.bat" ^> 07.txt

View File

@ -1,20 +0,0 @@
#!/bin/bash
export ANDROID_NDK_ROOT=~/SDKs/Android/NDK/android-ndk-r20b
export ANDROID_NDK_HOME=~/SDKs/Android/NDK/android-ndk-r20b
export ANDROID_HOME=~/SDKs/Android/SDK
cd ./engine
scons -j6 platform=android target=release_debug android_arch=armv7 entities_2d=yes
scons -j6 platform=android target=release_debug android_arch=arm64v8 entities_2d=yes
scons -j6 platform=android target=release_debug android_arch=x86 entities_2d=yes
cd ./platform/android/java
./gradlew generateGodotTemplates
cd ..
cd ..
cd ..
cd ..

View File

@ -1,20 +0,0 @@
#!/bin/bash
export ANDROID_NDK_ROOT=~/SDKs/Android/NDK/android-ndk-r20b
export ANDROID_NDK_HOME=~/SDKs/Android/NDK/android-ndk-r20b
export ANDROID_HOME=~/SDKs/Android/SDK
cd ./engine
scons -j6 platform=android target=release android_arch=armv7 entities_2d=yes
scons -j6 platform=android target=release android_arch=arm64v8 entities_2d=yes
scons -j6 platform=android target=release android_arch=x86 entities_2d=yes
cd ./platform/android/java
./gradlew generateGodotTemplates
cd ..
cd ..
cd ..
cd ..

View File

@ -4,8 +4,8 @@ export SCONS_CACHE_LIMIT=5000
cd ./engine
scons -j6 p=iphone tools=no target=release_debug arch=arm entities_2d=yes module_arkit_enabled=no game_center=no
scons -j6 p=iphone tools=no target=release_debug arch=arm64 entities_2d=yes module_arkit_enabled=no game_center=no
scons -j6 p=iphone tools=no target=release_debug arch=arm module_arkit_enabled=no game_center=no
scons -j6 p=iphone tools=no target=release_debug arch=arm64 module_arkit_enabled=no game_center=no
lipo -create bin/libgodot.iphone.opt.debug.arm.a bin/libgodot.iphone.opt.debug.arm64.a -output bin/libgodot.iphone.debug.fat.a
rm bin/ios_xcode/libgodot.iphone.debug.fat.a
cp bin/libgodot.iphone.debug.fat.a bin/ios_xcode/libgodot.iphone.debug.fat.a

View File

@ -4,8 +4,8 @@ export SCONS_CACHE_LIMIT=5000
cd ./engine
scons -j6 p=iphone tools=no target=release arch=arm entities_2d=yes module_arkit_enabled=no game_center=no
scons -j6 p=iphone tools=no target=release arch=arm64 entities_2d=yes module_arkit_enabled=no game_center=no
scons -j6 p=iphone tools=no target=release arch=arm module_arkit_enabled=no game_center=no
scons -j6 p=iphone tools=no target=release arch=arm64 module_arkit_enabled=no game_center=no
lipo -create bin/libgodot.iphone.opt.arm.a bin/libgodot.iphone.opt.arm64.a -output bin/libgodot.iphone.release.fat.a
rm bin/ios_xcode/libgodot.iphone.release.fat.a
cp bin/libgodot.iphone.release.fat.a bin/ios_xcode/libgodot.iphone.release.fat.a

View File

@ -1,6 +0,0 @@
cd ./engine
call scons -j6 platform=javascript tools=no target=release entities_2d=yes
cd ..

View File

@ -1,10 +0,0 @@
export SCONS_CACHE=~/.scons_cache
export SCONS_CACHE_LIMIT=5000
cd engine
scons -j2 platform=x11 target=release_debug entities_2d=yes
# use_llvm=yes

View File

@ -1,10 +0,0 @@
export SCONS_CACHE=~/.scons_cache
export SCONS_CACHE_LIMIT=5000
cd engine
scons -j2 platform=x11 target=release_debug entities_2d=yes
# use_llvm=yes

View File

@ -1,10 +0,0 @@
export SCONS_CACHE=~/.scons_cache
export SCONS_CACHE_LIMIT=5000
cd engine
scons -j2 platform=x11 target=release_debug entities_2d=yes tools=no
# use_llvm=yes

View File

@ -4,7 +4,7 @@ export SCONS_CACHE_LIMIT=5000
cd ./engine
scons -j6 platform=osx target=release_debug entities_2d=yes
scons -j6 platform=osx target=release_debug
rm -Rf bin/Godot.app
cp -r misc/dist/osx_tools.app ./bin/Godot.app

View File

@ -6,9 +6,9 @@ if not defined DevEnvDir (
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
)
call scons -j6 platform=uwp target=release entities_2d=yes
rem call scons -j6 platform=uwp target=release_debug entities_2d=yes
rem call scons -j6 platform=uwp target=release entities_2d=yes
call scons -j6 platform=uwp target=release
rem call scons -j6 platform=uwp target=release_debug
rem call scons -j6 platform=uwp target=release
cd ..

View File

@ -2,4 +2,5 @@
cp -u ./engine/bin/godot.x11.opt.tools.64 ./engine/bin/run.godot.x11.opt.tools.64
export LD_LIBRARY_PATH=`pwd`/engine/bin/
./engine/bin/run.godot.x11.opt.tools.64 -v

View File

@ -1 +1,3 @@
*
!module_manager
!module_manager/**

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Péter Magyar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,7 @@
# ESS Data
This is an addon for https://github.com/Relintai/entity_spell_system, to help with editing, and managing all game related the data in the project.
Looks like this:
![ess_data screenshot](screenshots/ess_data.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 939 B

View File

@ -2,15 +2,15 @@
importer="texture"
type="StreamTexture"
path="res://.import/wind-blue-1.png-29c9c4f83b5aef00d6a1aa6cc9858798.stex"
path="res://.import/empty.png-d52a27cebe3b559ee5afeb72c926ad8c.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/icons/icons-4/wind-blue-1.png"
dest_files=[ "res://.import/wind-blue-1.png-29c9c4f83b5aef00d6a1aa6cc9858798.stex" ]
source_file="res://addons/module_manager/icons/empty.png"
dest_files=[ "res://.import/empty.png-d52a27cebe3b559ee5afeb72c926ad8c.stex" ]
[params]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/gom.png-7469f830e410a943b31bbb19c8debf4e.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/gom.png"
dest_files=[ "res://.import/gom.png-7469f830e410a943b31bbb19c8debf4e.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_add.png-b78af00c3ee58b2d523f0a86c227a437.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/icon_add.png"
dest_files=[ "res://.import/icon_add.png-b78af00c3ee58b2d523f0a86c227a437.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_copy.png-2686b5282d44e971e22e560caf7cb772.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/icon_copy.png"
dest_files=[ "res://.import/icon_copy.png-2686b5282d44e971e22e560caf7cb772.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_display-name.png-b574a7070246a84b4ec56d12c5fe3d19.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/icon_display-name.png"
dest_files=[ "res://.import/icon_display-name.png-b574a7070246a84b4ec56d12c5fe3d19.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_duplicate.png-2fca67563e92c088a06d8cd03e837bd7.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/icon_duplicate.png"
dest_files=[ "res://.import/icon_duplicate.png-2fca67563e92c088a06d8cd03e837bd7.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_edit.png-2a909a80ec69c874db271f3116b05a4d.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/icon_edit.png"
dest_files=[ "res://.import/icon_edit.png-2a909a80ec69c874db271f3116b05a4d.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_empty.png-06c3b4befdd64e8111901e681b67622b.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/icon_empty.png"
dest_files=[ "res://.import/icon_empty.png-06c3b4befdd64e8111901e681b67622b.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_load.png-2950b376847c4a33baf8e4601a28c79c.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/icon_load.png"
dest_files=[ "res://.import/icon_load.png-2950b376847c4a33baf8e4601a28c79c.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_move_down.png-311d6181aa94759234bf843cb87c2d38.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/icon_move_down.png"
dest_files=[ "res://.import/icon_move_down.png-311d6181aa94759234bf843cb87c2d38.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_move_up.png-d4081170c845eac210690228db6a49a8.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/icon_move_up.png"
dest_files=[ "res://.import/icon_move_up.png-d4081170c845eac210690228db6a49a8.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_multi_line.png-5f84bb8f6a38a4a71b359efb46a0f143.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/icon_multi_line.png"
dest_files=[ "res://.import/icon_multi_line.png-5f84bb8f6a38a4a71b359efb46a0f143.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_options.png-1a80bcf95186ea96b32c86803be399a6.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/icon_options.png"
dest_files=[ "res://.import/icon_options.png-1a80bcf95186ea96b32c86803be399a6.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_reload_small.png-333a036d469daebe666d83e269723f24.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/icon_reload_small.png"
dest_files=[ "res://.import/icon_reload_small.png-333a036d469daebe666d83e269723f24.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_remove.png-e5d626378ae75827e240c9874314b07d.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/icon_remove.png"
dest_files=[ "res://.import/icon_remove.png-e5d626378ae75827e240c9874314b07d.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_rename.png-44332a5bb1664e3038d2db5a075584fe.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/icon_rename.png"
dest_files=[ "res://.import/icon_rename.png-44332a5bb1664e3038d2db5a075584fe.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_save.png-6f4eb3356472677111c577b4fc5fa9fd.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/icon_save.png"
dest_files=[ "res://.import/icon_save.png-6f4eb3356472677111c577b4fc5fa9fd.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_script.png-4160482016a5e5dbbb58043989a14452.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/module_manager/icons/icon_script.png"
dest_files=[ "res://.import/icon_script.png-4160482016a5e5dbbb58043989a14452.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -0,0 +1,64 @@
tool
extends ConfirmationDialog
signal ok_pressed
export(NodePath) var line_edit_path : NodePath
export(NodePath) var option_button_path : NodePath
var _resource_type : String
var _line_edit : LineEdit
var _option_button : OptionButton
func _ready():
_line_edit = get_node(line_edit_path) as LineEdit
_option_button = get_node(option_button_path) as OptionButton
connect("confirmed", self, "_on_OK_pressed")
connect("about_to_show", self, "about_to_show")
func set_resource_type(resource_type : String) -> void:
_resource_type = resource_type
func about_to_show():
_option_button.clear()
if not ClassDB.class_exists(_resource_type):
return
var arr : PoolStringArray = PoolStringArray()
arr.append(_resource_type)
arr.append_array(ClassDB.get_inheriters_from_class(_resource_type))
var gsc : Array = ProjectSettings.get("_global_script_classes")
var l : int = arr.size() - 1
while (arr.size() != l):
l = arr.size()
for i in range(gsc.size()):
var d : Dictionary = gsc[i] as Dictionary
var found = false
for j in range(arr.size()):
if arr[j] == d["class"]:
found = true
break
if found:
continue
for j in range(arr.size()):
if arr[j] == d["base"]:
arr.append(d["class"])
for a in arr:
_option_button.add_item(a)
func _on_OK_pressed():
emit_signal("ok_pressed", _line_edit.text, _option_button.get_item_text(_option_button.selected))
hide()

View File

@ -0,0 +1,58 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/module_manager/panels/CreateNamePopup.gd" type="Script" id=1]
[node name="CreateNamePopup" type="ConfirmationDialog"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -245.5
margin_top = -125.5
margin_right = 245.5
margin_bottom = 125.5
window_title = "Create New Resource"
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
line_edit_path = NodePath("VBoxContainer/LineEdit")
option_button_path = NodePath("VBoxContainer/OptionButton")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_left = 8.0
margin_top = 8.0
margin_right = 483.0
margin_bottom = 215.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label2" type="Label" parent="VBoxContainer"]
margin_right = 449.0
margin_bottom = 25.0
size_flags_horizontal = 3
text = "Type"
[node name="OptionButton" type="OptionButton" parent="VBoxContainer"]
margin_top = 33.0
margin_right = 449.0
margin_bottom = 70.0
size_flags_horizontal = 3
[node name="Label" type="Label" parent="VBoxContainer"]
margin_top = 78.0
margin_right = 449.0
margin_bottom = 103.0
size_flags_horizontal = 3
text = "Name"
[node name="LineEdit" type="LineEdit" parent="VBoxContainer"]
margin_top = 111.0
margin_right = 449.0
margin_bottom = 156.0
size_flags_horizontal = 3
caret_blink = true

View File

@ -0,0 +1,93 @@
tool
extends Control
signal inspect_data
signal duplicate
signal delete
export(PackedScene) var spatial_preview : PackedScene
export(PackedScene) var node2d_preview : PackedScene
export(PackedScene) var control_preview : PackedScene
export(PackedScene) var texture_preview : PackedScene
export(NodePath) var main_button_path : NodePath
var _main_button : Button
var _preview : Node
var _data : Resource
func _ready():
_main_button = get_node(main_button_path) as Button
func set_resource(data : Resource) -> void:
_data = data
_main_button.set_resource(data)
var name_text : String = ""
if data.has_method("get_id"):
name_text += str(data.get_id()) + " - "
if data.has_method("get_text_name"):
name_text += str(data.get_text_name())
else:
if data.resource_name != "":
name_text += data.resource_name
else:
name_text += data.resource_path
if data.has_method("get_rank"):
name_text += " - Rank " + str(data.get_rank())
if data is Texture:
_preview = texture_preview.instance()
add_child(_preview)
_preview.owner = self
move_child(_preview, 0)
_preview.set_texture(data as Texture)
elif data is PackedScene:
var n : Node = data.instance()
if _preview != null:
_preview.queue_free()
if n is Spatial:
_preview = spatial_preview.instance()
add_child(_preview)
_preview.owner = self
move_child(_preview, 0)
_preview.preview(n as Spatial)
elif n is Node2D:
_preview = node2d_preview.instance()
add_child(_preview)
_preview.owner = self
move_child(_preview, 0)
_preview.preview(n as Node2D)
elif n is Control:
_preview = control_preview.instance()
add_child(_preview)
_preview.owner = self
move_child(_preview, 0)
_preview.preview(n as Control)
else:
n.queue_free()
_main_button.text = name_text
func can_drop_data(position, data):
return false
func inspect():
emit_signal("inspect_data", _data)
func duplicate_data():
emit_signal("duplicate", _data)
func delete():
emit_signal("delete", _data)

View File

@ -0,0 +1,12 @@
tool
extends Button
export(int) var tab = 0
var _panel
func _pressed():
_panel.set_tab(tab)
func set_main_panel(panel):
_panel = panel

View File

@ -0,0 +1,10 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/module_manager/panels/FolderEntryButton.gd" type="Script" id=1]
[node name="FolderEntryButton" type="Button"]
margin_right = 210.0
margin_bottom = 20.0
size_flags_horizontal = 3
script = ExtResource( 1 )

View File

@ -0,0 +1,39 @@
tool
extends Button
signal history_entry_selected
var data : Resource setget set_data#, get_data
func _pressed() -> void:
emit_signal("history_entry_selected", data)
func set_data(pdata: Resource) -> void:
data = pdata
var s : String = "(" + data.get_class() + ") "
if data.has_method("get_id"):
s += str(data.get_id()) + " - "
if data.has_method("get_text_name"):
s += str(data.get_text_name())
if data.has_method("get_rank"):
s += " (R " + str(data.get_rank()) + ")"
text = s
func get_data() -> Resource:
return data
func get_drag_data(position):
if data == null:
return null
var d : Dictionary = Dictionary()
d["type"] = "resource"
d["resource"] = data
d["from"] = self
return d

View File

@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/module_manager/panels/HistoryEntry.gd" type="Script" id=1]
[node name="HistoryEntry" type="Button"]
margin_right = 236.0
margin_bottom = 37.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}

View File

@ -0,0 +1,89 @@
tool
extends Control
signal inspect_data
export(PackedScene) var resource_scene : PackedScene
export(PackedScene) var folder_entry_button_scene : PackedScene
export(String) var base_folder : String = "res://modules/"
export(NodePath) var main_container : NodePath
export(NodePath) var folder_entry_container_path : NodePath
var _main_container : Node
var _resource_scene : Node
var _folder_entry_container : Node
var _folders : Array = [
]
func _ready():
var dir : Directory = Directory.new()
if dir.file_exists("res://ess_data.json"):
var file : File = File.new()
if file.open("res://ess_data.json", File.READ) == OK:
var s : String = file.get_as_text()
_folders = parse_json(s)
file.close()
# else:
# var file : File = File.new()
#
# if file.open("res://ess_data.json", File.WRITE) == OK:
# file.store_string(to_json(_folders))
#
# file.close()
_main_container = get_node(main_container)
_resource_scene = resource_scene.instance()
_main_container.add_child(_resource_scene)
_resource_scene.owner = _main_container
_resource_scene.connect("inspect_data", self, "inspect_data")
_folder_entry_container = get_node(folder_entry_container_path)
for ch in _folder_entry_container.get_children():
ch.queue_free()
var index = 0
for f in _folders:
if f.has("header"):
var h : Label = Label.new()
_folder_entry_container.add_child(h)
h.owner = _folder_entry_container
h.text = f["header"]
var fe : Node = folder_entry_button_scene.instance()
_folder_entry_container.add_child(fe)
fe.owner = _folder_entry_container
fe.text = f["name"]
fe.tab = index
fe.set_main_panel(self)
index += 1
set_tab(0)
# set_tab("test")
func set_tab(tab_index : int) -> void:
hide_all()
_resource_scene.show()
_resource_scene.set_resource_type(_folders[tab_index]["folder"], _folders[tab_index]["type"])
func hide_all() -> void:
_resource_scene.hide()
func inspect_data(var data : Resource) -> void:
emit_signal("inspect_data", data)

View File

@ -0,0 +1,45 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/module_manager/panels/MainPanel.gd" type="Script" id=1]
[ext_resource path="res://addons/module_manager/panels/FolderEntryButton.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/module_manager/panels/ResourcePanel.tscn" type="PackedScene" id=3]
[node name="Panel" type="MarginContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
resource_scene = ExtResource( 3 )
folder_entry_button_scene = ExtResource( 2 )
base_folder = "res://data/"
main_container = NodePath("HSplitContainer/MarginContainer")
folder_entry_container_path = NodePath("HSplitContainer/ScrollContainer/VBoxContainer")
[node name="HSplitContainer" type="HSplitContainer" parent="."]
margin_right = 1024.0
margin_bottom = 600.0
size_flags_horizontal = 3
size_flags_vertical = 3
split_offset = 210
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ScrollContainer" type="ScrollContainer" parent="HSplitContainer"]
margin_right = 210.0
margin_bottom = 600.0
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="HSplitContainer/ScrollContainer"]
margin_right = 210.0
size_flags_horizontal = 3
[node name="MarginContainer" type="MarginContainer" parent="HSplitContainer"]
margin_left = 222.0
margin_right = 1024.0
margin_bottom = 600.0

View File

@ -0,0 +1,291 @@
tool
extends Control
signal inspect_data
export(PackedScene) var resource_row_scene : PackedScene
export(PackedScene) var history_row_scene : PackedScene
export(NodePath) var entry_container_path : NodePath
export(NodePath) var name_popup_path : NodePath
export(NodePath) var create_popup_path : NodePath
export(NodePath) var delete_popup_path : NodePath
export(NodePath) var history_container_path : NodePath
var _filter_term : String
var _entry_container : Node
var _name_popup : Node
var _create_popup : ConfirmationDialog
var _delete_popup : ConfirmationDialog
var _history_container : Node
var _folder : String
var _resource_type : String
var _queue_deleted : Resource
var _state : Dictionary
var _states : Dictionary
func _ready():
_history_container = get_node(history_container_path)
_entry_container = get_node(entry_container_path)
_name_popup = get_node(name_popup_path)
_name_popup.connect("ok_pressed", self, "ok_pressed")
_create_popup = get_node(create_popup_path)
_delete_popup = get_node(delete_popup_path)
func set_resource_type(folder : String, resource_type : String) -> void:
if folder == _folder and _resource_type == resource_type:
return
_states[_folder + "," + _resource_type] = _state
if _states.has(folder + "," + resource_type):
_state = _states[folder + "," + resource_type]
else:
_state = Dictionary()
_folder = folder
_resource_type = resource_type
# _filter_term = ""
_create_popup.set_resource_type(resource_type)
refresh()
func refresh() -> void:
for ch in _entry_container.get_children():
ch.queue_free()
var dir : Directory = Directory.new()
if dir.open(_folder) == OK:
dir.list_dir_begin()
var data_array : Array = Array()
var file_name = dir.get_next()
while (file_name != ""):
if not dir.current_is_dir():
if ResourceLoader.exists(_folder + file_name, _resource_type):
var res = ResourceLoader.load(_folder + file_name, _resource_type)
if _filter_term != "":
var ftext : String = ""
if res.has_method("get_text_name"):
ftext = res.get_text_name()
if ftext == "":
if res.resource_name != "":
ftext = res.resource_name
else:
ftext = res.resource_path
ftext = ftext.to_lower()
if ftext.find(_filter_term) == -1:
file_name = dir.get_next()
continue
var id : int = 0
if res.has_method("get_id"):
id = res.get_id()
data_array.append({
"id": id,
"resource": res
})
file_name = dir.get_next()
data_array.sort_custom(self, "sort_entries")
for d in data_array:
var resn : Node = resource_row_scene.instance()
_entry_container.add_child(resn)
resn.owner = _entry_container
resn.set_resource(d["resource"])
resn.connect("inspect_data", self, "inspect_data")
resn.connect("duplicate", self, "duplicate_data")
resn.connect("delete", self, "delete")
func inspect_data(var data : Resource) -> void:
var found : bool = false
for ch in _history_container.get_children():
if ch.data == data:
found = true
_history_container.move_child(ch, 0)
break
if not found:
var n : Node = history_row_scene.instance()
_history_container.add_child(n)
_history_container.move_child(n, 0)
n.owner = _history_container
n.data = data
n.connect("history_entry_selected", self, "inspect_data")
if _history_container.get_child_count() > 20:
var ch : Node = _history_container.get_child(_history_container.get_child_count() - 1)
ch.queue_free()
emit_signal("inspect_data", data)
func ok_pressed(res_name: String, pclass_name: String) -> void:
var d : Directory = Directory.new()
if d.open(_folder) == OK:
d.list_dir_begin()
var file_name = d.get_next()
var max_ind : int = 0
while (file_name != ""):
if not d.current_is_dir():
var curr_ind : int = int(file_name.split("_")[0])
if curr_ind > max_ind:
max_ind = curr_ind
file_name = d.get_next()
max_ind += 1
var newfname : String = str(res_name)
newfname = newfname.replace(" ", "_")
newfname = newfname.to_lower()
newfname = str(max_ind) + "_" + newfname + ".tres"
var res : Resource = null
if ClassDB.class_exists(pclass_name) and ClassDB.can_instance(pclass_name):
res = ClassDB.instance(pclass_name)
else:
var gsc : Array = ProjectSettings.get("_global_script_classes")
for i in range(gsc.size()):
var gsce : Dictionary = gsc[i] as Dictionary
if gsce["class"] == pclass_name:
var script : Script = load(gsce["path"])
res = script.new()
break
if res == null:
print("ESSData: Error in creating resource type " + pclass_name)
return
if res.has_method("set_id"):
res.set_id(max_ind)
if res.has_method("set_text_name"):
res.set_text_name(str(res_name))
ResourceSaver.save(_folder + newfname, res)
refresh()
func duplicate_data(data):
if not data is Resource:
return
var d : Directory = Directory.new()
if d.open(_folder) == OK:
d.list_dir_begin()
var file_name = d.get_next()
var max_ind : int = 0
while (file_name != ""):
if not d.current_is_dir():
var curr_ind : int = int(file_name.split("_")[0])
if curr_ind > max_ind:
max_ind = curr_ind
file_name = d.get_next()
max_ind += 1
var res_name : String = ""
if data.has_method("get_text_name"):
res_name = data.get_text_name()
var newfname : String = res_name
newfname = newfname.replace(" ", "_")
newfname = newfname.to_lower()
newfname = str(max_ind) + "_" + newfname + ".tres"
var res : Resource = data.duplicate()
if res.has_method("set_id"):
res.set_id(max_ind)
if res.has_method("set_text_name"):
res.set_text_name(str(res_name))
ResourceSaver.save(_folder + newfname, res)
refresh()
func delete(data):
if data == null or data as Resource == null:
return
_queue_deleted = data as Resource
_delete_popup.popup_centered()
func delete_confirm():
if _queue_deleted == null:
return
var d : Directory = Directory.new()
d.remove(_queue_deleted.resource_path)
_queue_deleted = null
refresh()
func clear_history() -> void:
for ch in _history_container.get_children():
ch.queue_free()
func search(text : String) -> void:
_filter_term = text.to_lower()
refresh()
func sort_entries(a, b):
return a["id"] < b["id"]

View File

@ -0,0 +1,118 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://addons/module_manager/panels/CreateNamePopup.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/module_manager/panels/ResourceRow.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/module_manager/panels/HistoryEntry.tscn" type="PackedScene" id=3]
[ext_resource path="res://addons/module_manager/icons/icon_add.png" type="Texture" id=4]
[ext_resource path="res://addons/module_manager/panels/ResourcePanel.gd" type="Script" id=5]
[ext_resource path="res://addons/module_manager/icons/icon_empty.png" type="Texture" id=6]
[ext_resource path="res://addons/module_manager/icons/icon_reload_small.png" type="Texture" id=7]
[node name="Panel" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 5 )
__meta__ = {
"_edit_use_anchors_": false
}
resource_row_scene = ExtResource( 2 )
history_row_scene = ExtResource( 3 )
entry_container_path = NodePath("ResourcePanel/VBoxContainer2/ScrollContainer2/VBoxContainer")
name_popup_path = NodePath("CreateNamePopup")
create_popup_path = NodePath("CreateNamePopup")
delete_popup_path = NodePath("DeletePopup")
history_container_path = NodePath("ResourcePanel/VBoxContainer/ScrollContainer/VBoxContainer")
[node name="ResourcePanel" type="HSplitContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
split_offset = 500
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer2" type="VBoxContainer" parent="ResourcePanel"]
margin_right = 664.0
margin_bottom = 600.0
[node name="LineEdit" type="LineEdit" parent="ResourcePanel/VBoxContainer2"]
margin_right = 664.0
margin_bottom = 45.0
right_icon = ExtResource( 6 )
placeholder_text = "Filter"
caret_blink = true
[node name="CreateButton" type="Button" parent="ResourcePanel/VBoxContainer2"]
margin_top = 53.0
margin_right = 664.0
margin_bottom = 90.0
rect_min_size = Vector2( 100, 0 )
text = "Create"
icon = ExtResource( 4 )
expand_icon = true
[node name="HSeparator" type="HSeparator" parent="ResourcePanel/VBoxContainer2"]
margin_top = 98.0
margin_right = 664.0
margin_bottom = 106.0
size_flags_horizontal = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ScrollContainer2" type="ScrollContainer" parent="ResourcePanel/VBoxContainer2"]
margin_top = 114.0
margin_right = 664.0
margin_bottom = 600.0
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="ResourcePanel/VBoxContainer2/ScrollContainer2"]
margin_right = 664.0
size_flags_horizontal = 3
[node name="VBoxContainer" type="VBoxContainer" parent="ResourcePanel"]
margin_left = 688.0
margin_right = 1024.0
margin_bottom = 600.0
[node name="Button" type="Button" parent="ResourcePanel/VBoxContainer"]
margin_right = 336.0
margin_bottom = 37.0
size_flags_horizontal = 3
text = "Clear History"
icon = ExtResource( 7 )
[node name="HSeparator" type="HSeparator" parent="ResourcePanel/VBoxContainer"]
margin_top = 45.0
margin_right = 336.0
margin_bottom = 53.0
size_flags_horizontal = 3
[node name="ScrollContainer" type="ScrollContainer" parent="ResourcePanel/VBoxContainer"]
margin_top = 61.0
margin_right = 336.0
margin_bottom = 600.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="ResourcePanel/VBoxContainer/ScrollContainer"]
margin_right = 336.0
size_flags_horizontal = 3
[node name="CreateNamePopup" parent="." instance=ExtResource( 1 )]
[node name="DeletePopup" type="ConfirmationDialog" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -139.0
margin_top = -55.0
margin_right = 139.0
margin_bottom = 55.0
dialog_text = "Delete?"
[connection signal="text_entered" from="ResourcePanel/VBoxContainer2/LineEdit" to="." method="search"]
[connection signal="pressed" from="ResourcePanel/VBoxContainer2/CreateButton" to="CreateNamePopup" method="popup"]
[connection signal="pressed" from="ResourcePanel/VBoxContainer/Button" to="." method="clear_history"]
[connection signal="confirmed" from="DeletePopup" to="." method="delete_confirm"]

View File

@ -0,0 +1,47 @@
[gd_scene load_steps=9 format=2]
[ext_resource path="res://addons/module_manager/previews/TexturePreview.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/module_manager/previews/ControlPreview.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/module_manager/previews/Node2DPreview.tscn" type="PackedScene" id=3]
[ext_resource path="res://addons/module_manager/previews/SpatialPreview.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/module_manager/panels/ResourceRowMainButton.gd" type="Script" id=5]
[ext_resource path="res://addons/module_manager/panels/EntryButton.gd" type="Script" id=6]
[ext_resource path="res://addons/module_manager/icons/icon_duplicate.png" type="Texture" id=7]
[ext_resource path="res://addons/module_manager/icons/icon_remove.png" type="Texture" id=8]
[node name="ResourceRow" type="HBoxContainer"]
margin_right = 634.0
margin_bottom = 37.0
rect_min_size = Vector2( 100, 0 )
size_flags_horizontal = 3
script = ExtResource( 6 )
__meta__ = {
"_edit_use_anchors_": false
}
spatial_preview = ExtResource( 4 )
node2d_preview = ExtResource( 3 )
control_preview = ExtResource( 2 )
texture_preview = ExtResource( 1 )
main_button_path = NodePath("ResourceRowMainButton")
[node name="ResourceRowMainButton" type="Button" parent="."]
margin_right = 570.0
margin_bottom = 37.0
size_flags_horizontal = 3
script = ExtResource( 5 )
[node name="Button2" type="Button" parent="."]
margin_left = 574.0
margin_right = 602.0
margin_bottom = 37.0
icon = ExtResource( 7 )
[node name="Button3" type="Button" parent="."]
margin_left = 606.0
margin_right = 634.0
margin_bottom = 37.0
icon = ExtResource( 8 )
[connection signal="pressed" from="ResourceRowMainButton" to="." method="inspect"]
[connection signal="pressed" from="Button2" to="." method="duplicate_data"]
[connection signal="pressed" from="Button3" to="." method="delete"]

View File

@ -0,0 +1,18 @@
tool
extends Button
var _data : Resource
func get_drag_data(position):
if _data == null:
return null
var d : Dictionary = Dictionary()
d["type"] = "resource"
d["resource"] = _data
d["from"] = self
return d
func set_resource(data : Resource) -> void:
_data = data

View File

@ -0,0 +1,7 @@
[plugin]
name="Entity Spell System Data Manager"
description=""
author="Relintai"
version="1.0"
script="plugin.gd"

View File

@ -0,0 +1,36 @@
tool
extends EditorPlugin
const _main_panel : PackedScene = preload("res://addons/module_manager/panels/MainPanel.tscn")
const _script_icon : Texture = preload("res://addons/module_manager/icons/icon_multi_line.png")
var _main_panel_instance : Control
func _enter_tree():
_main_panel_instance = _main_panel.instance() as Control
_main_panel_instance.connect("inspect_data", self, "inspect_data")
get_editor_interface().get_editor_viewport().add_child(_main_panel_instance)
make_visible(false)
func _exit_tree():
_main_panel_instance.queue_free()
func has_main_screen():
return true
func make_visible(visible):
if visible:
_main_panel_instance.show()
else:
_main_panel_instance.hide()
func get_plugin_icon():
return _script_icon
func get_plugin_name():
return "Modules"
func inspect_data(var data : Resource) -> void:
get_editor_interface().inspect_object(data)

View File

@ -0,0 +1,14 @@
tool
extends ViewportContainer
export(NodePath) var container_path : NodePath
var _container : Node
func _ready() -> void:
_container = get_node(container_path)
func preview(n: Control) -> void:
_container.add_child(n)
n.owner = _container

View File

@ -0,0 +1,22 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/module_manager/previews/ControlPreview.gd" type="Script" id=1]
[node name="ControlPreview" type="ViewportContainer"]
margin_right = 60.0
margin_bottom = 60.0
rect_min_size = Vector2( 60, 60 )
rect_pivot_offset = Vector2( -198.876, -96.6558 )
stretch = true
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
container_path = NodePath("Viewport")
[node name="Viewport" type="Viewport" parent="."]
size = Vector2( 500, 500 )
own_world = true
handle_input_locally = false
render_target_update_mode = 3

View File

@ -0,0 +1,14 @@
tool
extends ViewportContainer
export(NodePath) var container_path : NodePath
var _container : Node
func _ready() -> void:
_container = get_node(container_path)
func preview(n: Node2D) -> void:
_container.add_child(n)
n.owner = _container

View File

@ -0,0 +1,25 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/module_manager/previews/Node2DPreview.gd" type="Script" id=1]
[node name="Node2DPreview" type="ViewportContainer"]
margin_right = 60.0
margin_bottom = 60.0
rect_min_size = Vector2( 60, 60 )
rect_pivot_offset = Vector2( -198.876, -96.6558 )
stretch = true
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
container_path = NodePath("Viewport")
[node name="Viewport" type="Viewport" parent="."]
size = Vector2( 500, 500 )
own_world = true
handle_input_locally = false
render_target_update_mode = 3
[node name="Camera2D" type="Camera2D" parent="Viewport"]
current = true

View File

@ -0,0 +1,14 @@
tool
extends ViewportContainer
export(NodePath) var container_path : NodePath
var _container : Node
func _ready() -> void:
_container = get_node(container_path)
func preview(n: Spatial) -> void:
_container.add_child(n)
n.owner = _container

View File

@ -0,0 +1,29 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/module_manager/previews/SpatialPreview.gd" type="Script" id=1]
[node name="SpatialPreview" type="ViewportContainer"]
margin_right = 60.0
margin_bottom = 60.0
rect_min_size = Vector2( 60, 60 )
rect_pivot_offset = Vector2( -198.876, -96.6558 )
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
container_path = NodePath("Viewport")
[node name="Viewport" type="Viewport" parent="."]
size = Vector2( 60, 60 )
size_override_stretch = true
own_world = true
handle_input_locally = false
render_target_update_mode = 3
[node name="Camera" type="Camera" parent="Viewport"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 10.9828 )
current = true
[node name="DirectionalLight" type="DirectionalLight" parent="Viewport"]
transform = Transform( 0.276929, 0, -0.96089, 0, 1, 0, 0.96089, 0, 0.276929, -13.093, 0, 6.67786 )

View File

@ -0,0 +1,12 @@
tool
extends TextureRect
func set_texture(tex: Texture)-> void:
texture = tex
if tex is PackerImageResource:
var t : ImageTexture = ImageTexture.new()
t.create_from_image(tex.data, 0)
texture = t

View File

@ -0,0 +1,13 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/module_manager/previews/TexturePreview.gd" type="Script" id=1]
[node name="TexturePreview" type="TextureRect"]
margin_bottom = 37.0
rect_min_size = Vector2( 50, 50 )
expand = true
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}

View File

@ -1,22 +0,0 @@
[gd_scene load_steps=9 format=2]
[ext_resource path="res://autoload/CursorManager.gd" type="Script" id=1]
[ext_resource path="res://data/cursors/arrow16.png" type="Texture" id=2]
[ext_resource path="res://data/cursors/loot16.png" type="Texture" id=3]
[ext_resource path="res://data/cursors/attack16.png" type="Texture" id=4]
[ext_resource path="res://data/cursors/speak.png" type="Texture" id=5]
[ext_resource path="res://data/cursors/drag_drop.png" type="Texture" id=6]
[ext_resource path="res://data/cursors/forbidden.png" type="Texture" id=7]
[ext_resource path="res://data/cursors/ibeam.png" type="Texture" id=8]
[node name="CursorManager" type="Node"]
script = ExtResource( 1 )
default_cursor = ExtResource( 2 )
loot_cursor = ExtResource( 3 )
attack_cursor = ExtResource( 4 )
speak_cursor = ExtResource( 5 )
drag_drop_cursor = ExtResource( 6 )
forbidden_cursor = ExtResource( 7 )
text_cursor = ExtResource( 8 )
text_cursor_hotspot = Vector2( 2, 11 )

View File

@ -1,375 +0,0 @@
extends Node
# Copyright Péter Magyar relintai@gmail.com
# MIT License, functionality from this class needs to be protable to the entity spell system
# Copyright (c) 2019 Péter Magyar
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
export(PackedScene) var player_scene : PackedScene
export(PackedScene) var networked_player_scene : PackedScene
export(PackedScene) var mob_scene : PackedScene
export(PackedScene) var player_display_scene : PackedScene
export(String) var spawn_parent_path : String = "/root/Main"
export(int) var default_level_override : int = 0
var _spawn_parent : Node = null
var _next_entity_guid : int = 0
var _players : Array
var _mobs : Array
func _ready():
_spawn_parent = get_node(spawn_parent_path)
# get_tree().connect("network_peer_connected", self, "_player_connected")
# get_tree().connect("network_peer_disconnected", self, "_player_disconnected")
# get_tree().connect("connected_to_server", self, "_connected_ok")
# get_tree().connect("connection_failed", self, "_connected_fail")
# get_tree().connect("server_disconnected", self, "_server_disconnected")
pass
func spawn_for(player : Entity, target: Entity) -> void:
# print("spawnfor " + target.name)
rpc_id(player.get_network_master(), "creceive_spawn_for", to_json(target.to_dict()), target.name, target.translation)
func despawn_for(player : Entity, target: Entity) -> void:
# print("despawnfor " + target.name)
rpc_id(player.get_network_master(), "creceive_despawn_for", target.get_path())
remote func creceive_spawn_for(data: String, global_name : String, position: Vector2) -> void:
# print("recspawnfor " + global_name)
var entity : Entity = networked_player_scene.instance()
var spawn_parent = _spawn_parent.current_scene
spawn_parent.add_child(entity)
entity.owner = spawn_parent
entity.name = str(global_name)
entity.from_dict(parse_json(data))
entity.translation = position
Logger.info("Player spawned ")
_players.append(entity)
remote func creceive_despawn_for(path : NodePath) -> void:
# print("recdespawnfor " + path)
var ent = get_node_or_null(path)
if ent:
ent.queue_free()
func spawn_networked_player_from_data(data : String, position : Vector2, network_owner : int) -> Entity:
var entity : Entity = networked_player_scene.instance()
_next_entity_guid += 1
var spawn_parent = _spawn_parent.current_scene
spawn_parent.add_child(entity)
entity.owner = spawn_parent
entity.name = str(network_owner)
entity.from_dict(parse_json(data))
entity.set_network_master(network_owner)
entity.translation = position
Logger.info("Player spawned ")
_players.append(entity)
rpc_id(network_owner, "spawn_owned_player", data, position)
return entity
puppet func spawn_owned_player(data : String, position : Vector2) -> void:
var entity : Entity = player_scene.instance()
var spawn_parent = _spawn_parent.current_scene
spawn_parent.add_child(entity)
entity.owner = spawn_parent
entity.from_dict(parse_json(data))
entity.name = str(multiplayer.get_network_unique_id())
entity.translation = position
entity.set_network_master(multiplayer.get_network_unique_id())
Logger.info("Player spawned ")
func load_player(file_name : String, position : Vector2, network_owner : int) -> Entity:
# var createinfo : EntityCreateInfo = EntityCreateInfo.new()
#
# var cls : EntityData = Entities.get_player_character_data(class_id)
#
# var class_profile : ClassProfile = Profiles.get_class_profile(class_id)
#
# createinfo.entity_data = cls
# createinfo.player_name = name
# createinfo.level = class_profile.level
# createinfo.xp = class_profile.xp
# createinfo.entity_controller = EntityEnums.ENITIY_CONTROLLER_PLAYER
var entity : Entity = player_scene.instance()
_next_entity_guid += 1
var spawn_parent = _spawn_parent.current_scene
spawn_parent.add_child(entity)
entity.owner = spawn_parent
entity.from_dict(load_file(file_name))
entity.position = position
# entity.initialize(createinfo)
entity.set_network_master(network_owner)
Logger.info("Player spawned ")
_players.append(entity)
return entity
func spawn_display_player(name : String) -> Entity:
var entity : Entity = player_display_scene.instance() as Entity
entity.name = name
Logger.info("Player Display spawned")
return entity
func spawn_player_for_menu(class_id : int, name : String, parent : Node) -> Entity:
var createinfo : EntityCreateInfo = EntityCreateInfo.new()
var cls : EntityData = Entities.get_player_character_data(class_id)
var class_profile : ClassProfile = Profiles.get_class_profile(class_id)
createinfo.entity_data = cls
createinfo.player_name = name
createinfo.level = 1
createinfo.xp = class_profile.xp
createinfo.entity_controller = EntityEnums.ENITIY_CONTROLLER_PLAYER
var entity : Entity = player_display_scene.instance() as Entity
entity.initialize(createinfo)
var level : int = class_profile.level
if default_level_override > 0:
level = default_level_override
entity.slevelup(level - 1)
parent.add_child(entity)
entity.owner = parent
return entity
func spawn_networked_player(class_id : int, position : Vector2, name : String, node_name : String, sid : int) -> Entity:
var createinfo : EntityCreateInfo = EntityCreateInfo.new()
var cls : EntityData = Entities.get_entity_data(class_id)
var class_profile : ClassProfile = Profiles.get_class_profile(class_id)
createinfo.entity_data = cls
createinfo.player_name = name
createinfo.level = 1
createinfo.xp = class_profile.xp
createinfo.entity_controller = EntityEnums.ENITIY_CONTROLLER_PLAYER
var entity : Entity = spawn(createinfo, true, position, node_name)
var level : int = class_profile.level
if default_level_override > 0:
level = default_level_override
entity.slevelup(level - 1)
if get_tree().is_network_server():
entity.set_network_master(sid)
Logger.info("Player spawned " + str(createinfo))
_players.append(entity)
return entity
func spawn_player(class_id : int, position : Vector2, name : String, node_name : String, network_owner : int) -> Entity:
var createinfo : EntityCreateInfo = EntityCreateInfo.new()
var cls : EntityData = Entities.get_player_character_data(class_id)
var class_profile : ClassProfile = Profiles.get_class_profile(class_id)
createinfo.entity_data = cls
createinfo.player_name = name
createinfo.level = 1
createinfo.xp = class_profile.xp
createinfo.entity_controller = EntityEnums.ENITIY_CONTROLLER_PLAYER
var entity : Entity = spawn(createinfo, false, position, node_name)
var level : int = class_profile.level
if default_level_override > 0:
level = default_level_override
entity.slevelup(level - 1)
entity.set_network_master(network_owner)
Logger.info("Player spawned " + str(createinfo))
_players.append(entity)
return entity
func spawn_mob(class_id : int, level : int, position : Vector2) -> Entity:
var createinfo : EntityCreateInfo = EntityCreateInfo.new()
var cls : EntityData = Entities.get_entity_data(class_id)
if cls == null:
print("clsnull")
createinfo.entity_data = cls
createinfo.player_name = "Mob"
createinfo.level = 1
createinfo.entity_controller = EntityEnums.ENITIY_CONTROLLER_AI
var entity : Entity = spawn(createinfo, false, position)
if default_level_override > 0:
level = default_level_override
entity.slevelup(level - 1)
Logger.info("Mob spawned " + str(createinfo))
_mobs.append(entity)
return entity
func spawn(createinfo : EntityCreateInfo, networked : bool, position : Vector2, node_name : String = "") -> Entity:
var entity_node : Entity = null
if not networked:
if createinfo.entity_controller == EntityEnums.ENITIY_CONTROLLER_PLAYER:
entity_node = player_scene.instance()
else:
entity_node = mob_scene.instance()
else:
entity_node = networked_player_scene.instance()
if entity_node == null:
print("EntityManager: entity node is null")
return null
if node_name == "":
entity_node.name += "_" + str(_next_entity_guid)
else:
entity_node.name = node_name
_next_entity_guid += 1
var spawn_parent = _spawn_parent.current_scene
spawn_parent.add_child(entity_node)
entity_node.owner = spawn_parent
entity_node.position = position
entity_node.initialize(createinfo)
return entity_node
func _player_connected(id):
pass # Will go unused; not useful here.
func _player_disconnected(id):
#player_info.erase(id) # Erase player from info.
pass
func _connected_ok():
# Only called on clients, not server. Send my ID and info to all the other peers.
#rpc("register_player", get_tree().get_network_unique_id(), my_info)
pass
func _server_disconnected():
pass # Server kicked us; show error and abort.
func _connected_fail():
pass # Could not even connect to server; abort.
remote func register_player(id, info):
# Store the info
# player_info[id] = info
# If I'm the server, let the new guy know about existing players.
# if get_tree().is_network_server():
# # Send my info to new player
# rpc_id(id, "register_player", 1, my_info)
# # Send the info of existing players
# for peer_id in player_info:
# rpc_id(id, "register_player", peer_id, player_info[peer_id])
# Call function to update lobby UI here
pass
func load_file(file_name : String) -> Dictionary:
var f : File = File.new()
if f.open("user://characters/" + file_name, File.READ) == OK:
var st : String = f.get_as_text()
f.close()
var json_err : String = validate_json(st)
if json_err != "":
Logger.error("Save corrupted! " + file_name)
Logger.error(json_err)
return Dictionary()
var p = parse_json(st)
if typeof(p) != TYPE_DICTIONARY:
Logger.error("Save corrupted! Not Dict! " + file_name)
return Dictionary()
if p is Dictionary:
return p as Dictionary
return Dictionary()
func save_player(player: Entity, file_name : String) -> void:
var f : File = File.new()
if f.open("user://characters/" + file_name, File.WRITE) == OK:
f.store_string(to_json(player.to_dict()))
f.close()

View File

@ -1,26 +0,0 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://autoload/EntityDataManager.gd" type="Script" id=1]
[ext_resource path="res://player/NetworkedPlayer.tscn" type="PackedScene" id=2]
[ext_resource path="res://player/Player.tscn" type="PackedScene" id=3]
[ext_resource path="res://player/Mob.tscn" type="PackedScene" id=4]
[ext_resource path="res://player/DisplayPlayer.tscn" type="PackedScene" id=5]
[node name="EntityDataManager" type="EntityDataManager"]
xp_data_path = "res://data/xp/xp_data.tres"
entity_resources_folder = "res://data/entity_resources"
entity_skills_folder = "res://data/entity_skills"
entity_datas_folder = "res://data/entities"
spells_folder = "res://data/spells"
auras_folder = "res://data/auras"
world_spell_datas_folder = "res://data/world_spells"
craft_data_folder = "res://data/crafting"
item_template_folder = "res://data/item_templates"
mob_data_folder = "res://data/mob_data"
player_character_data_folder = "res://data/player_character_data"
script = ExtResource( 1 )
player_scene = ExtResource( 3 )
networked_player_scene = ExtResource( 2 )
mob_scene = ExtResource( 4 )
player_display_scene = ExtResource( 5 )
default_level_override = 50

View File

@ -1,85 +0,0 @@
extends ProfileManager
# Copyright Péter Magyar relintai@gmail.com
# MIT License, functionality from this class needs to be protable to the entity spell system
# Copyright (c) 2019 Péter Magyar
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#export (float) var save_interval : float = 20
#var last_save_time : float = 0
func _ready():
var save_game : File = File.new()
if save_game.file_exists("user://profile.save"):
load_full()
else:
load_defaults()
var actions : Array = InputMap.get_actions()
for action in actions:
var acts : Array = InputMap.get_action_list(action)
for i in range(len(acts)):
var a = acts[i]
if a is InputEventKey:
var nie : BSInputEventKey = BSInputEventKey.new()
nie.from_input_event_key(a as InputEventKey)
acts[i] = nie
InputMap.action_erase_event(action, a)
InputMap.action_add_event(action, nie)
func _save() -> void:
save_full()
func _load() -> void:
load_full()
func save_full() -> void:
var save_game = File.new()
save_game.open("user://profile.save", File.WRITE)
save_game.store_line(to_json(to_dict()))
save_game.close()
func load_full() -> void:
clear_class_profiles()
var save_game : File = File.new()
if save_game.file_exists("user://profile.save"):
if save_game.open("user://profile.save", File.READ) == OK:
var text : String = save_game.get_as_text()
if text == "":
load_defaults()
return
var save_json : Dictionary = parse_json(text)
from_dict(save_json)

View File

@ -1,6 +0,0 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://autoload/ProfileManager.gd" type="Script" id=1]
[node name="ProfileManager" type="ProfileManager"]
script = ExtResource( 1 )

View File

@ -1,6 +1,6 @@
extends Node
# Copyright (c) 2019 Péter Magyar
# Copyright (c) 2019-2020 Péter Magyar
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ -95,7 +95,7 @@ func connect_to_server_websocket(address : String = "127.0.0.1", p_port : int =
return err
func _network_peer_connected(id : int) -> void:
Logger.verbose("NetworkManager peer connected " + str(id))
# Logger.verbose("NetworkManager peer connected " + str(id))
# for p in splayers_array:
# rpc_id(id, "cspawn_player", p.my_info, p.sid, p.player.translation)
@ -111,7 +111,7 @@ func _network_peer_connected(id : int) -> void:
rpc_id(id, "cset_seed", _sseed)
func _network_peer_disconnected(id : int) -> void:
Logger.verbose("NetworkManager peer disconnected " + str(id))
# Logger.verbose("NetworkManager peer disconnected " + str(id))
var player : PlayerMaster = splayers_dict[id]
splayers_dict.erase(id)
@ -125,7 +125,7 @@ func _network_peer_disconnected(id : int) -> void:
emit_signal("splayer_master_destroyed", player)
func _connected_to_server() -> void:
Logger.verbose("NetworkManager _connected_to_server")
# Logger.verbose("NetworkManager _connected_to_server")
var pm : PlayerMaster = PlayerMaster.new()
pm.sid = get_tree().get_network_unique_id()
@ -135,7 +135,7 @@ func _connected_to_server() -> void:
emit_signal("cplayer_master_created", pm)
func _server_disconnected() -> void:
Logger.verbose("_server_disconnected")
# Logger.verbose("_server_disconnected")
# Server kicked us; show error and abort.
@ -144,7 +144,7 @@ func _server_disconnected() -> void:
player.queue_free()
func _connection_failed() -> void:
Logger.verbose("NetworkManager _connection_failed")
# Logger.verbose("NetworkManager _connection_failed")
pass # Could not even connect to server; abort.
@ -162,7 +162,7 @@ remote func cset_seed(pseed):
func set_class():
Logger.verbose("set_class")
# Logger.verbose("set_class")
if not get_tree().is_network_server():
rpc_id(1, "crequest_select_class", local_player_master.my_info)
@ -170,7 +170,7 @@ func set_class():
crequest_select_class(local_player_master.my_info)
remote func crequest_select_class(info : Dictionary) -> void:
Logger.verbose("NetworkManager crequest_select_class")
# Logger.verbose("NetworkManager crequest_select_class")
if get_tree().is_network_server():
var sid : int = get_tree().multiplayer.get_rpc_sender_id()
@ -178,14 +178,14 @@ remote func crequest_select_class(info : Dictionary) -> void:
if sid == 0:
sid = 1
rpc("cspawn_player", info, sid, Vector2(10, 10))
rpc("cspawn_player", info, sid, Vector3(10, 10, 10))
remotesync func cspawn_player(info : Dictionary, sid : int, pos : Vector2):
Logger.verbose("NetworkManager cspawn_player")
remotesync func cspawn_player(info : Dictionary, sid : int, pos : Vector3):
# Logger.verbose("NetworkManager cspawn_player")
if sid == get_tree().get_network_unique_id():
local_player_master.player = Entities.spawn_player(info["selected_class"] as int, pos, info["name"] as String, str(sid), sid)
local_player_master.player = ESS.get_ess_entity_spawner().spawn_player(info["selected_class"] as int, pos, info["name"] as String, str(sid), sid)
call_deferred("set_terrarin_player")
if get_tree().is_network_server() and not splayers_dict.has(sid):
@ -195,7 +195,7 @@ remotesync func cspawn_player(info : Dictionary, sid : int, pos : Vector2):
var pm : PlayerMaster = PlayerMaster.new()
pm.sid = sid
pm.player = Entities.spawn_networked_player(info["selected_class"] as int, pos, info["name"] as String, str(sid), sid)
pm.player = ESS.get_ess_entity_spawner().spawn_networked_player(info["selected_class"] as int, pos, info["name"] as String, str(sid), sid)
if get_tree().is_network_server() and not splayers_dict.has(sid):
splayers_dict[sid] = pm
@ -209,11 +209,12 @@ func upload_character(data : String) -> void:
rpc_id(1, "sreceive_upload_character", data)
master func sreceive_upload_character(data: String) -> void:
Entities.spawn_networked_player_from_data(data, Vector2(0, 0), multiplayer.get_rpc_sender_id())
ESS.get_ess_entity_spawner().spawn_networked_player_from_data(data, Vector3(0, 10, 0), multiplayer.get_rpc_sender_id())
func set_terrarin_player():
Logger.verbose("NetworkManager cspawn_player")
# Logger.verbose("NetworkManager cspawn_player")
var terrarin : Spatial = get_node("/root/GameScene/VoxelWorld")
var terrarin : Node = get_node("/root/GameScene/VoxelWorld")
terrarin.set_player(local_player_master.player as Node2D)
if terrarin.has_method("set_player"):
terrarin.set_player(local_player_master.player.get_body())

View File

@ -1,8 +0,0 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://autoload/WorldNumbers.gd" type="Script" id=1]
[ext_resource path="res://ui/numbers/Number.tscn" type="PackedScene" id=2]
[node name="WorldNumbers" type="Node"]
script = ExtResource( 1 )
number_scene = ExtResource( 2 )

View File

@ -1,6 +1,6 @@
[gd_scene load_steps=10 format=2]
[ext_resource path="res://player/CharacterSkeleton2D.gd" type="Script" id=1]
[ext_resource path="res://player/CharacterSkeleton2DGD.gd" type="Script" id=1]
[ext_resource path="res://characters/CharacterSideModel.tscn" type="PackedScene" id=2]
[ext_resource path="res://characters/CharacterFrontModel.tscn" type="PackedScene" id=3]
[ext_resource path="res://scripts/item_visuals/CharacterAtlas2D.gd" type="Script" id=4]
@ -45,7 +45,20 @@ HUMANOID_BONES_MAX = 16,"
texture = ExtResource( 6 )
slots = [ null, SubResource( 1 ), null, null, null, null, null, null, null, null, null, null, null, null, SubResource( 2 ), null ]
[node name="Character" type="CharacterSkeleton"]
[node name="Character" type="CharacterSkeleton2D"]
entity_type = 1
attach_point_paths/0_left_hand = NodePath("")
attach_point_paths/1_right_hand = NodePath("")
attach_point_paths/2_torso = NodePath("")
attach_point_paths/3_root = NodePath("")
attach_point_paths/4_right_hip = NodePath("")
attach_point_paths/5_left_hip = NodePath("")
attach_point_paths/6_spine_2 = NodePath("")
attach_point_paths/7_weapon_left = NodePath("")
attach_point_paths/8_weapon_right = NodePath("")
attach_point_paths/9_weapon_left_back = NodePath("")
attach_point_paths/10_weapon_right_back = NodePath("")
attach_point_paths/11_weapon_shield_left = NodePath("")
script = ExtResource( 1 )
front_node_path = NodePath("CharacterFrontModel")
front_animation_player_path = NodePath("../Character/CharacterFrontModel/AnimationPlayer")

Some files were not shown because too many files have changed in this diff Show More