Make accounts, service, and result more Nim friendly

This commit is contained in:
Joey Yakimowich-Payne 2018-06-24 12:01:35 +09:00
commit 83a79afb3d
8 changed files with 435 additions and 15 deletions

View file

@ -0,0 +1,28 @@
import libnx/wrapper/gfx
import libnx/wrapper/hid
import libnx/wrapper/console
import libnx/account
import libnx/utils
proc main() =
gfxInitDefault()
discard consoleInit(nil)
echo "\x1b[5;2H" & "Account info:"
withAccountService:
try:
let user = getActiveUser()
echo "\x1b[6;2HUsername: " & user.username
echo "\x1b[7;2HMiiID: " & $user.miiID
echo "\x1b[8;2HIconID: " & $user.iconID
except AccountError:
echo "\x1b[6;2HNo user currently selected!"
mainLoop:
let keysDown = hidKeysDown(CONTROLLER_P1_AUTO)
if (keysDown and KEY_PLUS.uint64) > 0.uint64:
break
main()

View file

@ -0,0 +1 @@
--path="../../src"