How to set the checkbox of NoAutoAssignSpecialists to checked by default?

lichen8566

Warlord
Joined
Dec 4, 2009
Messages
212
Location
Beijing, China
Everytime I establishe or occupy a new city, the checkbox of NoAutoAssignSpecialists specialists always be checked. And this is a very bad decision in the most of time.

Is there a solution to set it on by default? I read the CityView.lua, and found this:

Line:2086
Code:
Controls.NoAutoSpecialistCheckbox:SetCheck(pCity:IsNoAutoAssignSpecialists());

Line:2141
Code:
function AddSpecialist(iBuilding, slot)
	local pCity = UI.GetHeadSelectedCity();
				
	-- If Specialists are automated then you can't change things with them
	if (not pCity:IsNoAutoAssignSpecialists()) then
		Game.SelectedCitiesGameNetMessage(GameMessageTypes.GAMEMESSAGE_DO_TASK, TaskTypes.TASK_NO_AUTO_ASSIGN_SPECIALISTS, -1, -1, true);
		Controls.NoAutoSpecialistCheckbox:SetCheck(true);
	end
	
	local iSpecialist = GameInfoTypes[GameInfo.Buildings[iBuilding].SpecialistType];
	
	-- If we can add something, add it
	if (pCity:IsCanAddSpecialistToBuilding(iBuilding)) then
		Game.SelectedCitiesGameNetMessage(GameMessageTypes.GAMEMESSAGE_DO_TASK, TaskTypes.TASK_ADD_SPECIALIST, iSpecialist, iBuilding);
	end
	
	--g_iCurrentSpecialist = iSpecialist;
	specialistTable[iBuilding][slot] = true;
	
end

It looks like the state is changed by the C++ code. Should I add a lua hook to process it when establish or occupy a new city?

Thanks for any help.
 
Back
Top Bottom