Hello everyone! I’m a beginner and I want to make a separate section for pro users of my application. I made a menu layout, where there will be a few options by default, and if you navigate to the pro screen, where you will have to enter the code set by me and that’s how you unlock the rest of the options in the menu. I’ve been trying and I can’t do this. I put the code, I get a notification that it’s activated, but the menu doesn’t update. Do you have a solution or another method by which I can do this?
Hi Andrei,
Two methods come to mind that you could use:
- add all the elements in Screen.Initialize and, based on
"pro_unlocked"
, update the elements’ enabled property.
or
- when
"pro_unlocked"
changes, delete all the elements and recreate only the ones you need.
I tried with remove item and if which checks if it is pro then itm pro + normal and else the normal ones and it still doesn’t update. Tiny_DB1 is running, but the menu doesn’t update.
Hey @Car_Audio_Guide
please use instade of
to compare two thing (if they are not numeric) also you can make what @RaYzZz suggested.
ProMethod.aia (5.9 KB)
At initialization, check if pro-unlocked is active, then run the selectSideMenuLayout
procedure to update the interface by switching to the correct layout.
(I also added a disabled block with an alternative approach that updates the layout instead of removing and adding it, I think this method is even better.)
When the Activate button is clicked, check the password, save the status in TinyDB, update the layout using selectSideMenuLayout
, and show a confirmation message.
I also added a Deactivate button to disable Pro mode.
From the documentation Logic - Kodular Docs
It acts exactly the same as the = block found in Math
Taifun
Initially I wanted the code to be put on screen2, to have a separate page, but I did everything on the first page. Thank you and thank you to everyone who wanted to help me!
Also don’t forget to mark a solution for others in the community!