void UI::StartUI() { DisplayTitleScreen(); int result = StartMenu(); //Means quit game if (result == 1) { return; } CAI = SelectDifficulty(); //CurrentGame = Game(); PlacePieces(CurrentGame.GetP1Board()); GameResult gr = PlayGame(); return; }
/* * imgEditInit - initialization */ static BOOL imgEditInit( HANDLE currinst, HANDLE previnst, int cmdshow ) { WNDCLASS wc; HMENU menu; HDC hdc; BOOL maximized; int show_state; hdc = GetDC( NULL ); ColorPlanes = GetDeviceCaps( hdc, PLANES ); BitsPerPixel = GetDeviceCaps( hdc, BITSPIXEL ); ReleaseDC( NULL, hdc ); Instance = currinst; IEInitErrors( currinst ); IEInitGlobalStrings(); if( ImgedIsDDE ) { menu = LoadMenu( Instance, "IMGEDDDEMENU" ); } else { menu = LoadMenu( Instance, "IMGEDMENU" ); } hBitmapIcon = LoadIcon( Instance, "BitmapIcon" ); hIconIcon = LoadIcon( Instance, "IconIcon" ); hCursorIcon = LoadIcon( Instance, "CursorIcon" ); hAccel = LoadAccelerators( Instance, "Accelerators" ); IECtl3dInit( Instance ); #if defined( __NT__ ) hBkBrush = CreateSolidBrush( GetSysColor( COLOR_BTNFACE ) ); #endif /* * set up window class */ if( !previnst ) { wc.style = 0L; wc.lpfnWndProc = ImgEdFrameProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = Instance; wc.hIcon = LoadIcon( Instance, "APPLICON" ); wc.hCursor = LoadCursor( (HANDLE)NULL, IDC_ARROW ); wc.hbrBackground = NULL; wc.lpszMenuName = NULL; wc.lpszClassName = className; if( !RegisterClass( &wc ) ) { return( FALSE ); } } /* * This is the child of the MDI frame window (of it's client window actually). */ if( !previnst ) { wc.style = CS_BYTEALIGNWINDOW | CS_CLASSDC | CS_DBLCLKS; wc.lpfnWndProc = DrawAreaWinProc; wc.cbClsExtra = sizeof( HCURSOR ); wc.cbWndExtra = 0; wc.hInstance = Instance; wc.hIcon = hBitmapIcon; wc.hCursor = LoadCursor( (HANDLE)NULL, IDC_ARROW ); wc.hbrBackground = (HBRUSH)GetStockObject( WHITE_BRUSH ); wc.lpszMenuName = NULL; wc.lpszClassName = DrawAreaClassB; if( !RegisterClass( &wc ) ) { return( FALSE ); } } if( !previnst ) { wc.style = CS_BYTEALIGNWINDOW | CS_CLASSDC | CS_DBLCLKS; wc.lpfnWndProc = DrawAreaWinProc; wc.cbClsExtra = sizeof( HCURSOR ); wc.cbWndExtra = 0; wc.hInstance = Instance; wc.hIcon = hIconIcon; wc.hCursor = LoadCursor( (HANDLE)NULL, IDC_ARROW ); wc.hbrBackground = (HBRUSH)GetStockObject( WHITE_BRUSH ); wc.lpszMenuName = NULL; wc.lpszClassName = DrawAreaClassI; if( !RegisterClass( &wc ) ) { return( FALSE ); } } if( !previnst ) { wc.style = CS_BYTEALIGNWINDOW | CS_CLASSDC | CS_DBLCLKS; wc.lpfnWndProc = DrawAreaWinProc; wc.cbClsExtra = sizeof( HCURSOR ); wc.cbWndExtra = 0; wc.hInstance = Instance; wc.hIcon = hCursorIcon; wc.hCursor = LoadCursor( (HANDLE)NULL, IDC_ARROW ); wc.hbrBackground = (HBRUSH)GetStockObject( WHITE_BRUSH ); wc.lpszMenuName = NULL; wc.lpszClassName = DrawAreaClassC; if( !RegisterClass( &wc ) ) { return( FALSE ); } } if( !previnst ) { wc.style = 0L; wc.lpfnWndProc = ViewWindowProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = Instance; wc.hIcon = LoadIcon( NULL, IDI_APPLICATION ); wc.hCursor = LoadCursor( (HANDLE)NULL, IDC_ARROW ); wc.hbrBackground = (HBRUSH)GetStockObject( WHITE_BRUSH ); wc.lpszMenuName = NULL; wc.lpszClassName = ViewWinClass; if( !RegisterClass( &wc ) ) { return( FALSE ); } } if( !previnst ) { wc.style = 0L; wc.lpfnWndProc = ColorPalWinProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = Instance; wc.hIcon = NULL; wc.hCursor = LoadCursor( (HANDLE)NULL, IDC_ARROW ); #if defined( __NT__ ) wc.hbrBackground = hBkBrush; #else wc.hbrBackground = (HBRUSH)GetStockObject( LTGRAY_BRUSH ); #endif wc.lpszMenuName = NULL; wc.lpszClassName = PaletteClass; if( !RegisterClass( &wc ) ) { return( FALSE ); } } handCursor = LoadCursor( Instance, "HandCursor" ); if( !previnst ) { wc.style = CS_DBLCLKS; wc.lpfnWndProc = ColorsWndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = Instance; wc.hIcon = NULL; wc.hCursor = handCursor; #if defined( __NT__ ) wc.hbrBackground = hBkBrush; #else wc.hbrBackground = (HBRUSH)GetStockObject( LTGRAY_BRUSH ); #endif wc.lpszMenuName = NULL; wc.lpszClassName = "ColorsClass"; if( !RegisterClass( &wc ) ) { return( FALSE ); } } if( !previnst ) { wc.style = CS_DBLCLKS; wc.lpfnWndProc = ScreenWndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = Instance; wc.hIcon = NULL; wc.hCursor = handCursor; #if defined( __NT__ ) wc.hbrBackground = hBkBrush; #else wc.hbrBackground = (HBRUSH)GetStockObject( LTGRAY_BRUSH ); #endif wc.lpszMenuName = NULL; wc.lpszClassName = "ScreenClass"; if( !RegisterClass( &wc ) ) { return( FALSE ); } } if( !previnst ) { wc.style = 0L; wc.lpfnWndProc = CurrentWndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = Instance; wc.hIcon = NULL; wc.hCursor = LoadCursor( (HANDLE)NULL, IDC_ARROW ); #if defined( __NT__ ) wc.hbrBackground = hBkBrush; #else wc.hbrBackground = (HBRUSH)GetStockObject( LTGRAY_BRUSH ); #endif wc.lpszMenuName = NULL; wc.lpszClassName = "CurrentClass"; if( !RegisterClass( &wc ) ) { return( FALSE ); } } if( !previnst ) { wc.style = 0L; wc.lpfnWndProc = BitmapPickProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = Instance; wc.hIcon = NULL; wc.hCursor = NULL; #if defined( __NT__ ) wc.hbrBackground = hBkBrush; #else wc.hbrBackground = (HBRUSH)GetStockObject( LTGRAY_BRUSH ); #endif wc.lpszMenuName = NULL; wc.lpszClassName = BitmapPickClass; if( !RegisterClass( &wc ) ) { return( FALSE ); } } /* * Now make the main window. */ LoadImgedConfig(); maximized = ImgedConfigInfo.ismaximized; InitPalette(); HMainWindow = CreateWindow( className, /* Window class name */ IEAppTitle, /* Window caption */ WS_OVERLAPPEDWINDOW | WS_BORDER | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_DLGFRAME, /* Window style */ ImgedConfigInfo.x_pos, /* Initial X position */ ImgedConfigInfo.y_pos, /* Initial Y position */ ImgedConfigInfo.width, /* Initial X size */ ImgedConfigInfo.height, /* Initial Y size */ (HWND)NULL, /* Parent window handle */ (HMENU)menu, /* Window menu handle */ Instance, /* Program instance handle */ NULL ); /* Create parameters */ if( HMainWindow == NULL ) { return( FALSE ); } if( maximized ) { if( cmdshow == SW_SHOW || cmdshow == SW_SHOWNORMAL ) { show_state = SW_SHOWMAXIMIZED; } else { show_state = cmdshow; } } else { show_state = cmdshow; } ShowWindow( HMainWindow, show_state ); UpdateWindow( HMainWindow ); if( !ImgedIsDDE && !NoTitleScreen ) { DisplayTitleScreen( Instance, HMainWindow, 2000, IEAppTitle ); } CreateColorPal(); InitTools( HMainWindow ); GrayEditOptions(); #ifdef __NT__ DragAcceptFiles( HMainWindow, TRUE ); #endif //SetActiveWindow( HMainWindow ); BringWindowToTop( HMainWindow ); return( TRUE ); } /* imgEditInit */