Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
script not refreshed from file
(1/1)
BlueHazzard:
Hello!
it might be to late, but i have found a bug in the squirrel binding:
if my squirrel script (registered as plugin) creates a menu entry, and if i reload (open an register) the srcript a second time it wont be actualized to the new script.
It calls the old one.
in wxArrayInt CreateMenu(const wxString& name)
--- Code: ---int id = wxNewId();
mi.CreateFromString(arr[i], id);
--- End code ---
Here the menue entry is "not" created because it exists:
--- Code: ---// existing menu
// if it is the final item we want to create, display error and stop
if (isLast || existing >= (int)menu->GetMenuItemCount())
return 0;
--- End code ---
so a easy fix would be to add a bool parameter who signals to overwrite the old menu entry, or we ask at the script loading if the existing menu entry should be overwritten.
Probably it should be overwritten if the old and the new plugin had the same name...
Or we need in the menumanager a function to delete a menu so we can call it, when the plugin is unregistered (but how we find the right menu entry?).
greetings
BlueHazzard:
quick and dirty hack, without changing the sdk interface to much...
please test
greetings
oBFusCATed:
What about a proper solution, no matter if you have to change the SDK?
BlueHazzard:
I thought sdk interface changing aren't allowed...
i have uploaded a patch with the proper fix (i think). Still needs testing!
Patch ID: 003480
Navigation
[0] Message Index
Go to full version