Code Monkey home page Code Monkey logo

gdexcelexporter's People

Contributors

eterlan avatar kaluluosi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gdexcelexporter's Issues

支持多语言导出

试一下看能不能做到把string array_str 字段的值抽取出来放到语言表

int 无法存过大的数据

我的数据是int类型,值为120000000000000000000
Godot里会报错:
QQ截图20230429155533
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()

使用ee init 命令报错(使用旧版本的ee.exe同样失败)

请问这个缺少模块的问题如何解决
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'

ee gen-all报错

❯ 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'

增加csv导出器

csv导出器的主要目的是为了解决多语言表编辑问题。
官方多语言支持分两部分

  1. csv语言表
  2. gettext(.pot),又或者python-babel+godot-babel插件的gettext工具。

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数据源。

一点关于易用性的提议

  1. 在编辑器内运行脚本
@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

  1. 根据表格生成类文件会不会更好用一些,这样能用auto complete和类型检查

mkdocs调整

  1. 增加文档版本切换
  2. 增加更新日志页面

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.