godot-plugin-calendar-button icon indicating copy to clipboard operation
godot-plugin-calendar-button copied to clipboard

Image export error and uppercase issue

Open mutantant opened this issue 3 years ago • 7 comments

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.

mutantant avatar Apr 16 '21 20:04 mutantant

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)

ivanskodje avatar May 17 '21 15:05 ivanskodje

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)

revoltek avatar May 19 '21 21:05 revoltek

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?

ivanskodje avatar May 23 '21 11:05 ivanskodje

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)

revoltek avatar May 23 '21 13:05 revoltek

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

Kiwinir avatar Jul 30 '21 19:07 Kiwinir

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)

jokehzg avatar Dec 06 '21 18:12 jokehzg

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?

2nafish117 avatar Mar 06 '22 13:03 2nafish117