Forum Discussion
9 years ago
Also, as a side note:
Why do that, when you can do this?
The case instances fall through by default; that's why the "break" statements exist.
"Triplis;c-15778196" wrote:
Adding in another case:
protected function ShowOccultContent(param1:int) : *
{
switch(param1)
{
case OccultTypes.OCCULT_VAMPIRE:
this.mcVampireContent.visible = true;
this.mcVampireContent.HandleSimActivated(mSimId);
this.mcVampireContent.y = this.mcMotives.y + this.mcMotives.CalculateCommoditiesHeight() + SimInfoMotivePanelTunables.OCCULT_CONTENT_MARGIN.mTop;
break;
case OccultTypes.OCCULT_SORCERER:
this.mcVampireContent.visible = true;
this.mcVampireContent.HandleSimActivated(mSimId);
this.mcVampireContent.y = this.mcMotives.y + this.mcMotives.CalculateCommoditiesHeight() + SimInfoMotivePanelTunables.OCCULT_CONTENT_MARGIN.mTop;
break;
default:
this.mcVampireContent.visible = false;
}
this.RefreshPanelHeight();
}
Why do that, when you can do this?
protected function ShowOccultContent(param1:int) : *
{
switch(param1)
{
case OccultTypes.OCCULT_SORCERER:
case OccultTypes.OCCULT_VAMPIRE:
this.mcVampireContent.visible = true;
this.mcVampireContent.HandleSimActivated(mSimId);
this.mcVampireContent.y = this.mcMotives.y + this.mcMotives.CalculateCommoditiesHeight() + SimInfoMotivePanelTunables.OCCULT_CONTENT_MARGIN.mTop;
break;
default:
this.mcVampireContent.visible = false;
}
this.RefreshPanelHeight();
}
The case instances fall through by default; that's why the "break" statements exist.
About The Sims 4 Mods & Custom Content
Find expert tips, troubleshooting help, tutorials for mods and custom content, and The Sims 4 patch files in our forum.15,608 PostsLatest Activity: 9 hours ago
Community Highlights
Recent Discussions
- 7 hours ago
- 7 hours ago