• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

Restart HTML5 app?

Paul59

Active member
CX Code Contributor
Joined
Dec 13, 2018
Messages
384
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!
 
No. (from what I know)
I just close CServer and re-run the code
 
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
 
Ok I create module in 10 minute. haha.
Hope it work and can help you restart html from code.
 

Attachments

  • htmlreload.zip
    15.9 KB · Views: 233
Usually just reload the page in your browser.
Or if you make changes, just build and run.
 
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!
 
I test it, its work.
Just copy to 'modules_ext',

Cerberus:
Import htmlreload

HtmlReload.Do() 'to reload page.

I hope its help.
And I hope you doing well on game jam


588
 
@magic - ok, I'll try adding it tomorrow, just a few other things to get working first :D
 
@magic: you can access builtin js commands directly from within cerberus (no need to write an extra js file):

Cerberus:
#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.)
 
Back
Top Bottom