mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Fix to make soldier continue towards destination if previous path ended with a special move
Re-integrated LUA and console. Still many things to finish though. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1048 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+14
-6
@@ -244,9 +244,10 @@ Console::Console(LPCTSTR pszConfigFile, LPCTSTR pszShellCmdLine, LPCTSTR pszCons
|
||||
::SetStdHandle( STD_OUTPUT_HANDLE, myOut);
|
||||
::SetStdHandle( STD_ERROR_HANDLE, myOut);
|
||||
|
||||
int hConHandle = _open_osfhandle((long)myOut, _O_WTEXT);
|
||||
int hConHandle = _open_osfhandle((long)myOut, _O_BINARY); //_O_WTEXT);
|
||||
FILE *fp = _fdopen( hConHandle, "w" );
|
||||
*stdout = *fp;
|
||||
*stderr = *fp;
|
||||
setvbuf( stdout, NULL, _IONBF, 0 );
|
||||
|
||||
// create text monitor thread
|
||||
@@ -282,8 +283,10 @@ Console::~Console() {
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// creates and shows Console window
|
||||
|
||||
BOOL Console::Create(TCHAR* pszConfigPath) {
|
||||
BOOL Console::Create(HWND notify) {
|
||||
|
||||
m_notifyhWnd = notify;
|
||||
|
||||
if (m_hWnd)
|
||||
{
|
||||
::ShowWindow( m_hWnd, SW_SHOW);
|
||||
@@ -727,7 +730,6 @@ void Console::OnLButtonDown(UINT uiFlags, POINTS points) {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
wcout << "Test" << endl;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -947,6 +949,9 @@ void Console::OnChar(WORD myChar) {
|
||||
text[1] = '\r';
|
||||
text[2] = 0;
|
||||
Input += '\n';
|
||||
SendTextToConsole( text);
|
||||
SendMessage( m_notifyhWnd, WM_INPUTREADY, 0, (LPARAM) &Input);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4534,13 +4539,16 @@ DWORD Console::MonitorThread() {
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
void Console::AddOutput() {
|
||||
DWORD bytesRead;
|
||||
wchar_t buf[801];
|
||||
char buf[801];
|
||||
wchar_t wbuf[801];
|
||||
|
||||
::ReadFile( m_hStdOut, buf, sizeof(buf)/sizeof(wchar_t)-1, &bytesRead, NULL);
|
||||
if (bytesRead == 0) {
|
||||
return;
|
||||
}
|
||||
buf[bytesRead/sizeof(wchar_t)] = 0;
|
||||
SendTextToConsole( buf);
|
||||
buf[bytesRead] = 0;
|
||||
MultiByteToWideChar( CP_UTF8, 0, buf, -1, wbuf, sizeof(wbuf)/sizeof(wbuf[0]));
|
||||
SendTextToConsole( wbuf);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+3
-1
@@ -130,7 +130,7 @@ class Console {
|
||||
public:
|
||||
|
||||
// creates and shows Console window
|
||||
BOOL Create(TCHAR* pszConfigPath);
|
||||
BOOL Create(HWND notify);
|
||||
|
||||
private:
|
||||
|
||||
@@ -441,6 +441,8 @@ class Console {
|
||||
// Console window handle
|
||||
HWND m_hWnd;
|
||||
|
||||
HWND m_notifyhWnd;
|
||||
|
||||
// console colors
|
||||
COLORREF m_arrConsoleColors[16];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user