Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serialize into ModData and ModDetails #60

Merged
merged 4 commits into from
Jan 19, 2023

Conversation

Qubus0
Copy link
Collaborator

@Qubus0 Qubus0 commented Jan 17, 2023

for better type safety and convenience

this is only internal, nothing needs to be changed in mods.

@ithinkandicode check if this works for you to also integrate the config stuff

also closes #54

@ithinkandicode
Copy link
Collaborator

What's the difference between mod_details.gd and mod_data.gd? It looks like there's code for validation in both, would all the mod-specific stuff be better in a single file instead of split across two?

It might also be helpful to include a comment at the top of those files stating what their purpose is. Generally I think all funcs can benefit from comments, esp. if you're not familiar with the codebase.

For static funcs, would they be better being visually separated from the non-static funcs? Ie. you could move them down the file into their own section with comment headings. Eg. I used this approach throughout mod_loader.gd (eg here):

# Static Funcs
# =============================================================================

@Qubus0
Copy link
Collaborator Author

Qubus0 commented Jan 17, 2023

oh totally forgot to sort them again. will also add comments
ModDetails stores and validates all the content from the manifest, while ModData stores and validates everything needed to properly load the mod

Copy link
Collaborator

@ithinkandicode ithinkandicode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is amazing work, well done Ste! 🏆

I only have a few minor points: Potentially change a class name, and make the logging consistent

addons/mod_loader/mod_details.gd Outdated Show resolved Hide resolved

if re.search(version_number) == null:
printerr('Invalid semantic version: "%s". ' +
'You may only use numbers and periods in this format {mayor}.{minor}.{patch}' % version_number)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to show the mod name? That would make debugging much easier, esp. for logs like this which atm don't tell you which mod they're for

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, will do

addons/mod_loader/mod_details.gd Outdated Show resolved Hide resolved
@Qubus0
Copy link
Collaborator Author

Qubus0 commented Jan 17, 2023

will wait with merging until we have a logger class with static methods to log from, as those seem to work in engine and exported and with automatic setup.

ithinkandicode
ithinkandicode previously approved these changes Jan 17, 2023
Copy link
Collaborator

@ithinkandicode ithinkandicode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Like you said, there's a few bits left to do, but they can be raised in a subsequent PR

@ithinkandicode
Copy link
Collaborator

@Qubus0 I don't think we should use godot 4 documentation comments yet. The VS Code plugin for Godot already shows comments, but it doesn't handle the ## version correctly.

Eg this uses the normal # comment:

docstring-1

But it becomes this if you use ## for comments:

docstring-2

So I think we should hold off on using them until the plugin is fixed

@Qubus0
Copy link
Collaborator Author

Qubus0 commented Jan 18, 2023

hm that's a bummer. I guess it also doesn't handle the bbcode references to classes and methods? Looks like it's treating two ## as markdown heading

Copy link
Collaborator

@ithinkandicode ithinkandicode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think everything I mentioned before has been sorted here

And again, really great work Ste :)

@Qubus0 Qubus0 merged commit bd948c5 into GodotModding:main Jan 19, 2023
@Qubus0 Qubus0 deleted the serializing_mod_information branch January 19, 2023 23:02
@MythicManiac
Copy link

Does this account for leading zeroes? e.g. 01.01.01 should probably be disallowed

@Qubus0
Copy link
Collaborator Author

Qubus0 commented Jan 21, 2023

@MythicManiac not yet, but I can add it. Probably should also disallow numbers over 999, since right now versioning a la LaTeX is still possible (0.3.1415, adding a digit of pi for every update)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

validate mod ids completely
3 participants