Sub NewGame
Dialog.PutAtTop = True
Dialog.Title = csMsgTitle
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, 451dip, 440dip)
p.LoadLayout("GameType")
Dim rsp As ResumableSub = Dialog.ShowCustom(p, "Done", "", "")
Log(rsp.Completed)
Dim btnDone As B4XView = Dialog.GetButton(xui.DialogResponse_Positive)
btnDone.SetBitmap(bmpBtnUp)
AnimateDialog(Dialog, "bottom")
Wait For (rsp) Complete (Result As Int)
Log(rsp.Completed)
If Result = xui.DialogResponse_Positive Then
Log("Army: " & strArmy & ", Size: " & strSize & ", Type: " & strType)
If strArmy = "" Or strSize = "" Or strType = "" Then
Dialog.Close(xui.DialogResponse_Positive)
Dialog.Close(xui.DialogResponse_Negative)
Dialog.Close(xui.DialogResponse_Cancel)
Dialog.Close(Result)
rsp = Null
SendMsg(Error, "Not all options have been selected")
NewGame
End If
End If
' Initalize Database
sqlGameDB.Initialize(strGamesPath, strGameName, True)