unknown-horizons / godot-port

Unknown Horizons Godot Engine Port
https://www.unknown-horizons.org
GNU General Public License v2.0
663 stars 83 forks source link

Removed errors caused by repeated connection to signals. #105

Closed hepfnepf closed 1 year ago

hepfnepf commented 1 year ago
  1. Selecting the road builder would cause an error after the first time. connect: Signal 'tiles_changed' is already connected to given method 'update_tiles' in that object. This was because it tried to connect the stiles_changed signal ervery time. Thus i moved it to ready.
  2. The signal wiring in the switch widgets was completly broken. It appears, the original author wanted to notify all SwitchTabWidgets every the tab changes. But insted, every first time a widget got selected, it tried to connect the same signal 5 time to itself, insted of to the other nodes. Therefore making the system not work and also throwing already connected errors. This is now fixed. I think it would make more sense though, to move the signal wiring and tabcontainer setting to the parent node. I kept the code in here, because it seems the original auther explicitly wanted to have it here.
LinuxDonald commented 1 year ago

@hepfnepf could you please fix your other pr too :-)