Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25079
Modified Files:
console_win.cpp res.rc resource.h wolfpack.vcproj world.cpp
Added Files:
icon_green.ico icon_red.ico
Log Message:
Eyecandy for the Windows version.
--- NEW FILE: icon_green.ico ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: icon_red.ico ---
(This appears to be a binary file; contents omitted.)
Index: console_win.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_win.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** console_win.cpp 21 Jan 2004 22:14:07 -0000 1.23
--- console_win.cpp 30 Jan 2004 03:21:39 -0000 1.24
***************
*** 61,64 ****
--- 61,65 ----
HMENU hmMainMenu;
+ HICON iconRed = 0, iconGreen = 0;
HBITMAP hLogo = 0;
HWND lblUptime = 0, bmpLogo;
***************
*** 69,72 ****
--- 70,74 ----
HINSTANCE appInstance = 0; // Application Instance
HFONT font = 0; // The font we'll use
+ HFONT arialFont = 0; // ARIAL
unsigned int inputHeight = 0; // For measuring the height of the input field
unsigned int logLimit = 0; // How many characters fit into the log window
***************
*** 205,213 ****
dc = (HDC)wparam;
! SelectObject( dc, GetStockObject(ANSI_VAR_FONT) );
SetTextColor( dc, RGB( 0xAF, 0xAF, 0xAF ) );
SetBkMode( dc, TRANSPARENT );
! SelectObject( dc, GetStockObject( SYSTEM_FONT ) );
return (LRESULT)hbBackground;
}
--- 207,215 ----
dc = (HDC)wparam;
! //SelectObject( dc, GetStockObject(ANSI_VAR_FONT) );
SetTextColor( dc, RGB( 0xAF, 0xAF, 0xAF ) );
SetBkMode( dc, TRANSPARENT );
! //SelectObject( dc, GetStockObject( SYSTEM_FONT ) );
return (LRESULT)hbBackground;
}
***************
*** 234,238 ****
logLimit = SendMessage( logWindow, EM_GETLIMITTEXT, 0, 0 );
! // Set up the fonts we need
ZeroMemory( &lfont, sizeof( LOGFONT ) );
qstrcpy( lfont.lfFaceName, "Fixedsys" );
--- 236,245 ----
logLimit = SendMessage( logWindow, EM_GETLIMITTEXT, 0, 0 );
! // Set up the fonts we need
! ZeroMemory(&lfont, sizeof(LOGFONT));
! qstrcpy(lfont.lfFaceName, "Arial");
! lfont.lfQuality = ANTIALIASED_QUALITY;
! arialFont = CreateFontIndirect( &lfont );
!
ZeroMemory( &lfont, sizeof( LOGFONT ) );
qstrcpy( lfont.lfFaceName, "Fixedsys" );
***************
*** 267,270 ****
--- 274,279 ----
lblUptime = CreateWindow( "STATIC", 0, WS_CHILD|WS_VISIBLE, 400, 15, 250, 25, hwnd, 0, appInstance, 0 );
+ SendMessage( lblUptime, WM_SETFONT, (WPARAM)arialFont, 0 );
+
// Set up our timer to refresh the nice Uptime Counter
uptimeTimer = SetTimer( NULL, 0, 500, 0 );
***************
*** 354,357 ****
--- 363,368 ----
DeleteObject( hbSeparator );
DeleteObject( hbBackground );
+ DeleteObject( iconRed );
+ DeleteObject( iconGreen );
keeprun = 0;
PostQuitMessage( 0 );
***************
*** 456,463 ****
hbSeparator = CreateSolidBrush( RGB( 0xAF, 0xAF, 0xAF ) );
hbBackground = CreateSolidBrush( RGB( 0, 64, 38 ) );
// Create the WindowClass
! WNDCLASS wpClass;
! ZeroMemory( &wpClass, sizeof( WNDCLASS ) );
wpClass.hInstance = hInstance;
wpClass.lpfnWndProc = wpWindowProc;
--- 467,477 ----
hbSeparator = CreateSolidBrush( RGB( 0xAF, 0xAF, 0xAF ) );
hbBackground = CreateSolidBrush( RGB( 0, 64, 38 ) );
+ iconGreen = (HICON)LoadImage(appInstance, MAKEINTRESOURCE(IDI_ICONGREEN), IMAGE_ICON, 16, 16, 0);
+ iconRed = (HICON)LoadImage(appInstance, MAKEINTRESOURCE(IDI_ICONRED), IMAGE_ICON, 16, 16, 0);
// Create the WindowClass
! WNDCLASSEX wpClass;
! ZeroMemory( &wpClass, sizeof( WNDCLASSEX ) );
! wpClass.cbSize = sizeof(WNDCLASSEX);
wpClass.hInstance = hInstance;
wpClass.lpfnWndProc = wpWindowProc;
***************
*** 466,472 ****
wpClass.hbrBackground = hbBackground;
wpClass.lpszClassName = WOLFPACK_CLASS;
wpClass.style = CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW;
! if (!RegisterClass(&wpClass))
{
MessageBox(0, "Couldn't register Window Class.", "Window Class", MB_OK|MB_ICONERROR);
--- 480,487 ----
wpClass.hbrBackground = hbBackground;
wpClass.lpszClassName = WOLFPACK_CLASS;
+ wpClass.hIconSm = iconRed;
wpClass.style = CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW;
! if (!RegisterClassEx(&wpClass))
{
MessageBox(0, "Couldn't register Window Class.", "Window Class", MB_OK|MB_ICONERROR);
***************
*** 476,480 ****
// Create the Window itself
hmMainMenu = LoadMenu( appInstance, MAKEINTRESOURCE( IDR_MAINMENU ) );
-
mainWindow = CreateWindow( WOLFPACK_CLASS, "Wolfpack", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 640, 480, NULL, hmMainMenu, hInstance, NULL );
--- 491,494 ----
***************
*** 520,523 ****
--- 534,550 ----
sprintf( message, "Uptime: %u:%02u:%02u:%02u", days, hours, minutes, seconds );
SetWindowText( lblUptime, message );
+
+ // Update the icon
+ static unsigned int lastState = 0xFFFFFFFF;
+
+ if (lastState != serverState) {
+ if (serverState == RUNNING) {
+ SendMessage(mainWindow, WM_SETICON, ICON_SMALL, (WPARAM)iconGreen);
+ } else {
+ SendMessage(mainWindow, WM_SETICON, ICON_SMALL, (WPARAM)iconRed);
+ }
+ }
+
+ lastState = serverState;
}
Index: res.rc
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/res.rc,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** res.rc 13 Oct 2003 00:11:47 -0000 1.19
--- res.rc 30 Jan 2004 03:21:39 -0000 1.20
***************
*** 1,3 ****
! //Microsoft Developer Studio generated resource script.
//
#include "resource.h"
--- 1,3 ----
! // Microsoft Visual C++ generated resource script.
//
#include "resource.h"
***************
*** 8,12 ****
// Generated from the TEXTINCLUDE 2 resource.
//
!
/////////////////////////////////////////////////////////////////////////////
--- 8,12 ----
// Generated from the TEXTINCLUDE 2 resource.
//
! #include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
***************
*** 14,20 ****
/////////////////////////////////////////////////////////////////////////////
! // Deutsch (Deutschland) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
/////////////////////////////////////////////////////////////////////////////
--- 14,24 ----
/////////////////////////////////////////////////////////////////////////////
! // German (Germany) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
+ #ifdef _WIN32
+ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
+ #pragma code_page(1252)
+ #endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
***************
*** 25,36 ****
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
! IDI_ICON1 ICON DISCARDABLE "icon2.ico"
!
! /////////////////////////////////////////////////////////////////////////////
! //
! // Bitmap
! //
!
! IDB_LOGO BITMAP DISCARDABLE "logo.bmp"
/////////////////////////////////////////////////////////////////////////////
--- 29,35 ----
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
! IDI_ICON1 ICON "icon2.ico"
! IDI_ICONGREEN ICON "icon_green.ico"
! IDI_ICONRED ICON "icon_red.ico"
/////////////////////////////////////////////////////////////////////////////
***************
*** 39,43 ****
//
! IDR_MAINMENU MENU DISCARDABLE
BEGIN
POPUP "&File"
--- 38,42 ----
//
! IDR_MAINMENU MENU
BEGIN
POPUP "&File"
***************
*** 60,64 ****
- #ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
--- 59,62 ----
***************
*** 66,70 ****
//
! VS_VERSION_INFO VERSIONINFO
FILEVERSION 12,9,4,0
PRODUCTVERSION 13,0,0,0
--- 64,68 ----
//
! 1 VERSIONINFO
FILEVERSION 12,9,4,0
PRODUCTVERSION 13,0,0,0
***************
*** 83,98 ****
BLOCK "040904b0"
BEGIN
! VALUE "Comments", "http://www.wpdev.org/\0"
! VALUE "CompanyName", "Wolfpack Development Team\0"
! VALUE "FileDescription", "Ultima Online Server Emulator\0"
! VALUE "FileVersion", "12, 9, 4, 0\0"
! VALUE "InternalName", "\0"
! VALUE "LegalCopyright", "© 2002-2003 Wolfpack Dev. Team\0"
! VALUE "LegalTrademarks", "\0"
! VALUE "OriginalFilename", "wolfpack.exe\0"
! VALUE "PrivateBuild", "\0"
! VALUE "ProductName", "Wolfpack Emu\0"
! VALUE "ProductVersion", "13, 0, 0, 0\0"
! VALUE "SpecialBuild", "\0"
END
END
--- 81,92 ----
BLOCK "040904b0"
BEGIN
! VALUE "Comments", "http://www.wpdev.org/"
! VALUE "CompanyName", "Wolfpack Development Team"
! VALUE "FileDescription", "Ultima Online Server Emulator"
! VALUE "FileVersion", "12, 9, 4, 0"
! VALUE "LegalCopyright", "© 2002-2003 Wolfpack Dev. Team"
! VALUE "OriginalFilename", "wolfpack.exe"
! VALUE "ProductName", "Wolfpack Emu"
! VALUE "ProductVersion", "13, 0, 0, 0"
END
END
***************
*** 103,108 ****
END
- #endif // !_MAC
-
#ifdef APSTUDIO_INVOKED
--- 97,100 ----
***************
*** 112,127 ****
//
! 1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
! 2 TEXTINCLUDE DISCARDABLE
BEGIN
! "\r\n"
"\0"
END
! 3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
--- 104,119 ----
//
! 1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
! 2 TEXTINCLUDE
BEGIN
! "#include ""afxres.h""\r\n"
"\0"
END
! 3 TEXTINCLUDE
BEGIN
"\r\n"
***************
*** 131,135 ****
#endif // APSTUDIO_INVOKED
! #endif // Deutsch (Deutschland) resources
/////////////////////////////////////////////////////////////////////////////
--- 123,134 ----
#endif // APSTUDIO_INVOKED
!
! /////////////////////////////////////////////////////////////////////////////
! //
! // Bitmap
! //
!
! IDB_LOGO BITMAP "logo.bmp"
! #endif // German (Germany) resources
/////////////////////////////////////////////////////////////////////////////
Index: resource.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/resource.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** resource.h 13 Oct 2003 00:11:47 -0000 1.11
--- resource.h 30 Jan 2004 03:21:39 -0000 1.12
***************
*** 1,9 ****
//{{NO_DEPENDENCIES}}
! // Microsoft Developer Studio generated include file.
// Used by res.rc
//
#define IDI_ICON1 101
- #define IDB_LOGO 102
#define IDR_MAINMENU 102
#define IDC_EXIT 40001
#define ID_RELOAD_ACCOUNTS 40002
--- 1,12 ----
//{{NO_DEPENDENCIES}}
! // Microsoft Visual C++ generated include file.
// Used by res.rc
//
#define IDI_ICON1 101
#define IDR_MAINMENU 102
+ #define IDB_LOGO 102
+ #define IDI_ICONGREEN 105
+ #define IDI_ICON3 106
+ #define IDI_ICONRED 106
#define IDC_EXIT 40001
#define ID_RELOAD_ACCOUNTS 40002
***************
*** 18,22 ****
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
! #define _APS_NEXT_RESOURCE_VALUE 105
#define _APS_NEXT_COMMAND_VALUE 40009
#define _APS_NEXT_CONTROL_VALUE 1000
--- 21,26 ----
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
! #define _APS_NO_MFC 1
! #define _APS_NEXT_RESOURCE_VALUE 107
#define _APS_NEXT_COMMAND_VALUE 40009
#define _APS_NEXT_CONTROL_VALUE 1000
Index: wolfpack.vcproj
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.vcproj,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** wolfpack.vcproj 26 Jan 2004 03:48:40 -0000 1.8
--- wolfpack.vcproj 30 Jan 2004 03:21:39 -0000 1.9
***************
*** 533,536 ****
--- 533,548 ----
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
<File
+ RelativePath=".\icon2.ico">
+ </File>
+ <File
+ RelativePath=".\icon_green.ico">
+ </File>
+ <File
+ RelativePath=".\icon_red.ico">
+ </File>
+ <File
+ RelativePath=".\logo.bmp">
+ </File>
+ <File
RelativePath=".\res.rc">
</File>
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** world.cpp 30 Jan 2004 01:59:21 -0000 1.56
--- world.cpp 30 Jan 2004 03:21:39 -0000 1.57
***************
*** 677,682 ****
uoTime.setTime_t( db_time.toInt() );
Console::instance()->ProgressDone();
!
! Console::instance()->send("Worldtime is " + uoTime.toString() + ".\n" );
persistentBroker->disconnect();
--- 677,682 ----
uoTime.setTime_t( db_time.toInt() );
Console::instance()->ProgressDone();
!
! Console::instance()->send(QString("Worldtime is %1 on %3. %4 in year %5").arg(uoTime.time().toString()).arg(uoTime.date().day()).arg(QDate::monthName(uoTime.date().month())).arg(uoTime.date().year() - 1970) + ".\n" );
persistentBroker->disconnect();
|