HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
Making threads to link to banned members content grants an automatic ban
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 Toogle grass code help

View previous topic View next topic Go down 
AuthorMessage
MissClaire

avatar

Game username : MissDiealot
Server : Journey Kingdom (Dev)
Female Posts : 7
Join date : 2017-08-11
Age : 15
Location : France

PostSubject: Toogle grass code help   Mon Aug 14, 2017 12:07 am

henlo

so im trying to get the grass toogle on/off setting working, though i am getting stuck at one point.

in my magixGUI, i have wrote that in so when you click on the grass on/off button, it makes the grass dissapear on the map.

Code:
void toggleGrassOn()
 {
 isGrassOnFlag = !isGrassOnFlag;
 mButtonText[BUTTON_SETTINGS2]->setCaption((isGrassOnFlag?"On":"Off"));
 if(isGrassOnFlag)
 {
 delete mGrass->getPageLoader();
 delete mGrass;
 mGrass = 0;
 }
 }
 bool isGrassOn()
 {
 return isGrassOnFlag;
 }

however when i want to build the solution, it says that mGrass hasn't been defined in all three lines here

Code:
delete mGrass->getPageLoader();
 delete mGrass;
 mGrass = 0;

could someone enlighten me please?

thank you, have a nice day!
Back to top Go down
https://missdiealot.deviantart.com/
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 483
Join date : 2014-02-09
Age : 19

PostSubject: Re: Toogle grass code help   Mon Aug 14, 2017 4:14 am

mGrass isn't defined anywhere in magixGUI

________________________________
Back to top Go down
http://azoptaos.boards.net/
MissClaire

avatar

Game username : MissDiealot
Server : Journey Kingdom (Dev)
Female Posts : 7
Join date : 2017-08-11
Age : 15
Location : France

PostSubject: Re: Toogle grass code help   Tue Aug 15, 2017 11:06 pm

how would i define it then? i'm still new to coding, not sure what to do there :/
Back to top Go down
https://missdiealot.deviantart.com/
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 483
Join date : 2014-02-09
Age : 19

PostSubject: Re: Toogle grass code help   Tue Aug 15, 2017 11:20 pm

i'm assuming you got the mGrass code from magixworld? you can't move code across files like that, you need to make some sort of trigger variable that's true or false and then determine if the grass should load in magixworld with it

________________________________
Back to top Go down
http://azoptaos.boards.net/
MissClaire

avatar

Game username : MissDiealot
Server : Journey Kingdom (Dev)
Female Posts : 7
Join date : 2017-08-11
Age : 15
Location : France

PostSubject: Re: Toogle grass code help   Thu Aug 17, 2017 2:14 pm

yeah i did get the code from there lol, thought it'd make sense
thank you i understand now! i'll bump this post when i get some more stuff done with it <:
Back to top Go down
https://missdiealot.deviantart.com/
 
Toogle grass code help
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: SUPPORT :: Support-
Jump to: