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

Image export error and uppercase issue #6

Open
mutantant opened this issue Apr 16, 2021 · 7 comments
Open

Image export error and uppercase issue #6

mutantant opened this issue Apr 16, 2021 · 7 comments

Comments

@mutantant
Copy link

Hey there. Great widget.

Godot 3.2.3 stable.

Installed the addon, activated it. Added the CalendarButton to the scene. Shows up as a small calendar icon. So far so good.

But when you try to run the project you get:
Parser Error: Unique global class "Calendar" already exists at path: res://addons/calendar_button/class/Calendar.gd

Also:
W 0:00:00.711 _open: Case mismatch opening requested file 'calendar.gd', stored as 'Calendar.gd' in the filesystem. This file will not open when exported to other case-sensitive platforms. <C++ Source> drivers/windows/file_access_windows.cpp:105 @ _open() <Stack Trace> calendar_buttons.gd:4 @ _init() calendar_script.gd:40 @ create_calendar_buttons() calendar_script.gd:17 @ _enter_tree()

W 0:00:00.692 load: Loaded resource as image file, this will not work on export: 'res://addons/calendar_button/btn_img/btn_32x32_03.png'. Instead, import the image file as an Image resource and load it normally as a resource. <C++ Source> core/image.cpp:1894 @ load() <Stack Trace> calendar_script.gd:30 @ create_button_texture() calendar_script.gd:22 @ setup_calendar_icon() calendar_script.gd:15 @ _enter_tree()

W 0:00:00.702 load: Loaded resource as image file, this will not work on export: 'res://addons/calendar_button/btn_img/btn_32x32_04.png'. Instead, import the image file as an Image resource and load it normally as a resource. <C++ Source> core/image.cpp:1894 @ load() <Stack Trace> calendar_script.gd:30 @ create_button_texture() calendar_script.gd:25 @ setup_calendar_icon() calendar_script.gd:15 @ _enter_tree()

Oddly, if I change var calendar = load("res://addons/calendar_button/class/calendar.gd").new() in caneldar_buttons.gd to var calendar = load("res://addons/calendar_button/class/Calendar.gd").new() (note the capital C), it runs fine, but still throws errors about exporting and the images.

And it is true, as I exported and the calendar button does not display in the exported file, though it still reads clicks if you know where it is supposed to be. In other words, as the errors warn, the images for the calendar buttons are not being exported, leaving a blank button.

@ivanskodje
Copy link
Collaborator

ivanskodje commented May 17, 2021

Thanks for letting me know!

Can you download the ZIP file of this branch and test to see if that fixes it?
https://github.com/ivanskodje-godotengine/godot-plugin-calendar-button/tree/test-fix1

This works on 3.3 for me, without any of the errors you mention.

Install instructions:

  • Download ZIP file (Press the "Code" button -> ZIP)
  • Delete your current addons folder
  • Copy and paste the addons folder from the zip file (after unzipping it, of course)
  • Make sure the plugin is enabled (perhaps re-enabling it)

@revoltek
Copy link

Hello, thanks for the plugin!
I confirm the bug in 3.2.3 stable also with the new branch (not tested in 3.3 yet)

@ivanskodje
Copy link
Collaborator

Hello, thanks for the plugin!
I confirm the bug in 3.2.3 stable also with the new branch (not tested in 3.3 yet)

Did you try the branch I posted?

@revoltek
Copy link

yes, the "test-fix1", I see a few changes in terms of spaces but the error is the same. I think the suggestion of @mutantant to add the capital C in caneldar_buttons.gd would help (at least it starts with that)

@Kiwinir
Copy link

Kiwinir commented Jul 30, 2021

As it is still open issue, I have found than in calendar_script.gd you have to change line 22 - 23 in func setup_calendar_icon() to this line
self.texture_normal = load("res://addons/calendar_button/btn_img/" + "btn_32x32_03.png")
and second line with var pressed_texture to this line
self.texture_pressed = load("res://addons/calendar_button/btn_img/" + "btn_32x32_04.png")

I have also commented out func create_button_texture

Hope this helps anyone

@jokehzg
Copy link

jokehzg commented Dec 6, 2021

Thanks for this plugin, it helps me a lot.

And I met this message in 3.4 stable too.

I tried to change line 4 to var calendar : Calendar in calendar_buttons.gd and modify func _init like this

func _init(var calendar_script, var buttons_container : GridContainer, var cal: Calendar):
	self.buttons_container = buttons_container
	setup_button_signals(calendar_script)
	calendar = cal

then change line 40 to return CalendarButtons.new(self, calendar_container, calendar) in calendar_script.gd

Now it's working without error msg (by the way, i have to restart the editor to make the scripts reload)

@2nafish117
Copy link

I also had this issue. This is probably related to windows being case insensitive. I had to delete some of the files and paste the contents back into new files to fix this.
Can anyone running linux see if this error appears?

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

No branches or pull requests

6 participants