Package net.openosrs.api.input.motion
Class MouseProfileStore
- java.lang.Object
-
- net.openosrs.api.input.motion.MouseProfileStore
-
@Singleton public class MouseProfileStore extends java.lang.ObjectLoads and saves movement profiles as one JSON file per profile.Profiles live under
~/.openosrs/mouse-profiles. One file each, rather than a single combined document, so that a profile can be copied to another machine, kept in version control or hand-edited without risking the rest. Every load is sanitised: these files are user-editable and the trainer writes them, so nothing read from disk is trusted.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_PROFILE
-
Constructor Summary
Constructors Constructor Description MouseProfileStore()MouseProfileStore(java.nio.file.Path directory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandelete(java.lang.String name)java.nio.file.PathgetDirectory()voidinvalidate()Drop cached profiles so the next load re-reads from disk.java.util.List<java.lang.String>list()MouseProfileload(java.lang.String name)Load a profile by name, falling back to built-in defaults.voidsave(MouseProfile profile)
-
-
-
Field Detail
-
DEFAULT_PROFILE
public static final java.lang.String DEFAULT_PROFILE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDirectory
public java.nio.file.Path getDirectory()
-
load
public MouseProfile load(java.lang.String name)
Load a profile by name, falling back to built-in defaults.A missing file is not an error: a fresh install has no profiles and should still move sensibly. A corrupt file is logged once and then also falls back, because refusing to move at all is a worse outcome than moving with defaults.
-
save
public void save(MouseProfile profile)
-
list
public java.util.List<java.lang.String> list()
-
delete
public boolean delete(java.lang.String name)
-
invalidate
public void invalidate()
Drop cached profiles so the next load re-reads from disk.
-
-