Restart HTML5 app?

Paul59

Active Member
Joined
Dec 13, 2018
Location
UK
Is there any way to restart an HTML5 app from within code eg force a page reload or something??

It'll save me lots of time for this jam!
 

magic

Active Member
3rd Party Tool Dev
Joined
Mar 5, 2018
No. (from what I know)
I just close CServer and re-run the code
 

magic

Active Member
3rd Party Tool Dev
Joined
Mar 5, 2018
I think can be created by modify html templete, add a button and apply js command location.reload()
But that still not from within code
 

magic

Active Member
3rd Party Tool Dev
Joined
Mar 5, 2018
Ok I create module in 10 minute. haha.
Hope it work and can help you restart html from code.
 

Attachments

MikeHart

Administrator
Staff member
Joined
Jun 19, 2017
Location
Germany
Usually just reload the page in your browser.
Or if you make changes, just build and run.
 

Paul59

Active Member
Joined
Dec 13, 2018
Location
UK
Thank you both. I'm just looking for a quick way to start the app afresh without adding more spaghetti!! If it's too much hassle I'll just get players to re-load the page :D

@magic This is for the game jam so I'm afraid I don't have time to look at your code now but hopefully it will be useful in future!
 

magic

Active Member
3rd Party Tool Dev
Joined
Mar 5, 2018
I test it, its work.
Just copy to 'modules_ext',

Cerberus X:
Import htmlreload

HtmlReload.Do() 'to reload page.
I hope its help.
And I hope you doing well on game jam


588
 

PixelPaladin

Active Member
CX Code Contributor
3rd Party Module Dev
Joined
Aug 27, 2017
Location
Germany
@magic: you can access builtin js commands directly from within cerberus (no need to write an extra js file):

Cerberus X:
#If TARGET="html5"
Extern
Function ReloadApp:Void() = "location.reload"
Public
#Else
Function ReloadApp:Void()
End
#End
(This code is compatible with all targets but ReloadApp() does nothing on non-html5 applications.)
 
Top Bottom