Public Sub setName
Private cDlg As CustomLayoutDialog
Private im As IME
im.Initialize("")
cDlg.ShowAsync(Starter.loc.Localize("My Name / Nickname"), Starter.loc.Localize("Save"), Starter.loc.Localize("Cancel"), "", LoadBitmap(File.DirAssets, "ic_person_black_24dp.png"), False)
cDlg.SetSize(310dip, 250dip)
Wait For Dialog_Ready(pnl As Panel)
pnl.LoadLayout("username")
txtUserName.EditText.InputType = Bit.Or(txtUserName.EditText.INPUT_TYPE_TEXT, 8192)
txtUserName.EditText.Hint = Starter.loc.Localize("My Name / Nickname")
im.ShowKeyboard(txtUserName.EditText)
If Starter.cOpts.PlayerName <> "Not Set" Then txtUserName.Text = Starter.cOpts.PlayerName
Wait For Dialog_Result(res As Int)
If res = DialogResponse.POSITIVE Then
Starter.cOpts.PlayerName = txtUserName.Text
Starter.cOpts.Write_Options
loadMenuItems
End If
Sleep(50)
im.HideKeyboard
End Sub