kaluluosi / gdexcelexporter Goto Github PK
View Code? Open in Web Editor NEW为Godot开发的excel表导出工具
Home Page: https://kaluluosi.github.io/GDExcelExporter/
License: MIT License
为Godot开发的excel表导出工具
Home Page: https://kaluluosi.github.io/GDExcelExporter/
License: MIT License
❯ ee gen-all
gen-WARNING:没有配置文件,将使用内置默认配置
gen-ERROR:未捕获异常
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "D:\Applications\Scoop\apps\python\current\Scripts\ee.exe\__main__.py", line 4, in <module>
from excelexporter.__main__ import main
File "D:\Applications\Scoop\apps\python\current\Lib\site-packages\excelexporter\__main__.py", line 3, in <module>
main()
File "D:\Applications\Scoop\apps\python\current\Lib\site-packages\click\core.py", line 1130, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Applications\Scoop\apps\python\current\Lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "D:\Applications\Scoop\apps\python\current\Lib\site-packages\click\core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Applications\Scoop\apps\python\current\Lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Applications\Scoop\apps\python\current\Lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Applications\Scoop\apps\python\current\Lib\site-packages\excelexporter\cli.py", line 109, in gen_all
exporter.gen_all(cwd)
File "D:\Applications\Scoop\apps\python\current\Lib\site-packages\excelexporter\exporter.py", line 266, in gen_all
on_completed()
File "D:\Applications\Scoop\apps\python\current\Lib\site-packages\excelexporter\exporter.py", line 53, in on_completed
completed_gd()
File "D:\Applications\Scoop\apps\python\current\Lib\site-packages\excelexporter\exporter.py", line 247, in completed_gd
with open(settings_file_path, "a+", newline="\n", encoding="utf-8") as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'dist\\Settings.gd'
讲generator插件化
导表失败的时候弹出一个对话框,然后把异常信息写在里面。
csv导出器的主要目的是为了解决多语言表编辑问题。
官方多语言支持分两部分
1是属于配置性的多语言方案,先配置好文本块,然后再由项目控件、代码引用。
2是属于全自动导出,它会遍历整个项目所有tr()函数包裹的内容,将文本抽取保存为pot文件,这个pot文件用poedit工具编辑导出别的语言表。
gettext(.pot)方案是最省事开发体验最好的方案,因为你开发过程是用母语开发,不用每时每刻都想着要先配个语言表再去项目里引用。代码的可读性也强。
godot4.0也内置了pot导出,不过pyhon-babel仍然有他的优势,因为它可以配置导出规则文件匹配要导出的目录,内置的只能手动一个个添加。
csv语言表比较僵硬,不过也有它的优势,就是工具简单,只需要个excel就可以用。
可惜问题是csv再excel里的编辑体验不好不如xlsx可以有各种格式,另外excel保存的csv格式跟godot csv importer的要求不匹配。csv importer只识别utf-8 无bom,LF换行符的csv。excel保存的csv总有兼容问题。
因此增加一个csv导出器方案,导出csv数据源。
@tool
extends EditorScript
# Called when the script is executed (using File -> Run in Script Editor).
func _run() -> void:
var output = []
var
OS.execute("CMD.exe", ["/c", "D:\\Godot\\Projects\\Ranger\\db\\gen_all.bat"], output)
print(output)
bat文件要加上 cd db
Godot 4.0的GDScript已经升级到了2.0,多了一些有用的语法,比如终于有lambda了。
针对4.0适配一个版本。
我的数据是int类型,值为120000000000000000000
Godot里会报错:
E 0:00:00:0842 settings.gd:5 @ @implicit_new(): Cannot represent 120000000000000000000 as a 64-bit signed integer, since the value is too large.
<C++ 错误> Condition "overflow" is true. Returning: sign == 1 ? 9223372036854775807LL : (-9223372036854775807LL - 1)
<C++ 源文件> core/string/ustring.cpp:2233 @ to_int()
<栈追踪> settings.gd:5 @ @implicit_new()
台式机用的Windows,笔记本用的Mac,迫切需要支持Mac。
请问这个缺少模块的问题如何解决
ee init
root-CRITICAL:未捕获异常
Traceback (most recent call last):
File "e:\python\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "e:\python\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "E:\python\Scripts\ee.exe_main.py", line 4, in
from gd_excelexporter.cli import cli
File "e:\python\lib\site-packages\gd_excelexporter\cli.py", line 8, in
from gd_excelexporter.core.generator import Generator
File "e:\python\lib\site-packages\gd_excelexporter\core\generator.py", line 11, in
from gd_excelexporter.config import Configuration
File "e:\python\lib\site-packages\gd_excelexporter\config.py", line 3, in
from packaging.version import Version, parse
ModuleNotFoundError: No module named 'packaging'
配置“类型”相关的字段时,若果类型太多,用int还是不太方便。
思路是为每个REOURCE的datatable类创建一个内置class,这样Godot就可以识别到RESOURCE里每一行数据的类以提供代码提示。
主要是用来排除一些注释用字段,不导出的
https://blog.csdn.net/m0_56083621/article/details/115041998
好像是因为这个,大佬有兴趣解决吗
README说明文档太过老旧,有很多高级内容导致文档太大,做一下整理。
试一下看能不能做到把string array_str 字段的值抽取出来放到语言表
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.