from lnx.logicnode.lnx_nodes import * class WriteStorageNode(LnxLogicTreeNode): """Writes a given value to the application's default storage file. Each value is uniquely identified by a key, which can be used to later read the value from the storage file. Each key can only refer to one value, so writing a second value with a key that is already used overwrites the already stored value with the second value. The location of the default storage file varies on different platforms, as implemented by the Kha storage API: - *Windows*: `%USERPROFILE%/Saved Games//default.kha` - *Linux*: one of `$HOME/./default.kha`, `$XDG_DATA_HOME/./default.kha` or `$HOME/.local/share/default.kha` - *MacOS*: `~/Library/Application Support//default.kha` - *iOS*: `~/Library/Application Support//default.kha` - *Android*: `//files/default.kha` - *HTML 5*: saved in the local storage (web storage API) for the project's [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). `` refers to the name set at `Leenkx Exporter > Name`, `` is the generated package name on Android. @seeNode Read Storage """ bl_idname = 'LNWriteStorageNode' bl_label = 'Write Storage' lnx_section = 'file' lnx_version = 1 def lnx_init(self, context): self.add_input('LnxNodeSocketAction', 'In') self.add_input('LnxStringSocket', 'Key') self.add_input('LnxDynamicSocket', 'Value') self.add_output('LnxNodeSocketAction', 'Out')