Bubbet Posted August 10, 2020 Share Posted August 10, 2020 getTab and getActiveTab both error in a player attached script (not in context of menu) and return non valid tabs in entity attached script meaning you cant do anything with them like disable them. The exact result i was attempting to get to was disabling the hangar tab. But neither approach allowed me to do that. Link to comment Share on other sites More sharing options...
Bubbet Posted August 10, 2020 Author Share Posted August 10, 2020 It would appear PlayerWindow has the same issues. Link to comment Share on other sites More sharing options...
Rinart73 Posted August 11, 2020 Share Posted August 11, 2020 (edited) I think this only happens if an active tab was created on the C++ side (like the inventory tab). You could try to use tab callbacks for your tabs to know when they're active: local myTab = shipWindow:createTab("My Tab Name"%_t, "path/to/icon", "My Tab Name"%_t) myTab.onSelectedFunction = "onMyTabSelected" myTab.onShowFunction = "onMyTabShown" Edited August 11, 2020 by Rinart73 Link to comment Share on other sites More sharing options...
Bubbet Posted August 11, 2020 Author Share Posted August 11, 2020 I suppose that makes sense, but then you've got no way to disable things like the hangar. The devs have mentioned that they cannot go back on making fighters craftable. But without being able to disable that tab i don't see a way as a modder to disable fighter production. Link to comment Share on other sites More sharing options...
Rinart73 Posted August 12, 2020 Share Posted August 12, 2020 (edited) Quote But without being able to disable that tab i don't see a way as a modder to disable fighter production. Tbh disabling the tab will only disable the UI - client-side part of it. A person with coding experience will find a way to bypass it. How about using the following code? It should delete all squads blueprints on server side from time to time. function DisableFighterProduction.getUpdateInterval() return 20 end function DisableFighterProduction.updateServer() local entity = Entity() if entity:hasComponent(ComponentType.Hangar) then local hangar = Hangar() for i = 0, hangar.numSquads then hangar:setBlueprint(i, nil) end end end Edited August 12, 2020 by Rinart73 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now