From bbd89835b30ca0edfa591071c007755254488e64 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 11 Aug 2016 20:38:45 +1000 Subject: [PATCH] [Project64] Add Support window --- Config/Project64.cfg.development | 2 + Lang/English.pj.Lang | 16 ++ Source/Project64-core/Multilanguage.h | 16 ++ .../Multilanguage/LanguageClass.cpp | 16 ++ Source/Project64/Project64.vcproj | 16 ++ Source/Project64/Project64.vcxproj | 4 + Source/Project64/Settings/UISettings.cpp | 2 + Source/Project64/Settings/UISettings.h | 3 + Source/Project64/UserInterface.h | 1 + .../UserInterface/SupportEnterCode.cpp | 61 ++++++++ .../UserInterface/SupportEnterCode.h | 23 +++ .../Project64/UserInterface/SupportWindow.cpp | 147 ++++++++++++++++++ .../Project64/UserInterface/SupportWindow.h | 43 +++++ Source/Project64/UserInterface/UIResources.rc | 38 +++++ Source/Project64/UserInterface/resource.h | 10 +- Source/Project64/main.cpp | 2 + 16 files changed, 398 insertions(+), 2 deletions(-) create mode 100644 Source/Project64/UserInterface/SupportEnterCode.cpp create mode 100644 Source/Project64/UserInterface/SupportEnterCode.h create mode 100644 Source/Project64/UserInterface/SupportWindow.cpp create mode 100644 Source/Project64/UserInterface/SupportWindow.h diff --git a/Config/Project64.cfg.development b/Config/Project64.cfg.development index 4c0d97d40..fa3563c36 100644 --- a/Config/Project64.cfg.development +++ b/Config/Project64.cfg.development @@ -36,3 +36,5 @@ Directory=..\..\Lang Directory=..\..\Textures\ Use Selected=1 +[Support Project64] +Run Count=-1 diff --git a/Lang/English.pj.Lang b/Lang/English.pj.Lang index d6806936e..57a1c8a5f 100644 --- a/Lang/English.pj.Lang +++ b/Lang/English.pj.Lang @@ -440,6 +440,22 @@ #1104# "Options" #1105# "Save Slots" +/********************************************************************************* +* Support Window * +*********************************************************************************/ +#1200# "Support Project64" +#1201# "Project64 is a software package designed to emulate a Nintendo64 video game system on a Microsoft Windows based PC. This allows you to play real N64 software in much the same way as it would be on the original hardware system.\n\nIf you like Project64 and have gotten some value out of it then please support project64 as either a thank you, or your desire to see it continually improved.\n\nIf you have supported project64:" +#1202# "Enter notification code" +#1203# "Support Project64" +#1204# "Continue" +#1205# "Please enter the support code" +#1206# "Incorrect support code" +#1207# "Thank you" +#1208# "Enter code" +#1209# "Please enter the code in the email" +#1210# "OK" +#1211# "Cancel" + /********************************************************************************* * Messages * *********************************************************************************/ diff --git a/Source/Project64-core/Multilanguage.h b/Source/Project64-core/Multilanguage.h index 6b92dad3b..4ac410b91 100644 --- a/Source/Project64-core/Multilanguage.h +++ b/Source/Project64-core/Multilanguage.h @@ -471,6 +471,22 @@ enum LanguageStringID STR_SHORTCUT_OPTIONS = 1104, STR_SHORTCUT_SAVESLOT = 1105, + /********************************************************************************* + * Support Window * + *********************************************************************************/ + MSG_SUPPORT_TITLE = 1200, + MSG_SUPPORT_INFO = 1201, + MSG_SUPPORT_ENTER_CODE = 1202, + MSG_SUPPORT_PROJECT64 = 1203, + MSG_SUPPORT_CONTINUE = 1204, + MSG_SUPPORT_ENTER_SUPPORT_CODE = 1205, + MSG_SUPPORT_INCORRECT_CODE = 1206, + MSG_SUPPORT_COMPLETE = 1207, + MSG_SUPPORT_ENTER_CODE_TITLE = 1208, + MSG_SUPPORT_ENTER_CODE_DESC = 1209, + MSG_SUPPORT_OK = 1210, + MSG_SUPPORT_CANCEL = 1211, + /********************************************************************************* * Messages * *********************************************************************************/ diff --git a/Source/Project64-core/Multilanguage/LanguageClass.cpp b/Source/Project64-core/Multilanguage/LanguageClass.cpp index db41d0a69..ae1c88659 100644 --- a/Source/Project64-core/Multilanguage/LanguageClass.cpp +++ b/Source/Project64-core/Multilanguage/LanguageClass.cpp @@ -439,6 +439,22 @@ void CLanguage::LoadDefaultStrings(void) DEF_STR(STR_SHORTCUT_OPTIONS, "Options"); DEF_STR(STR_SHORTCUT_SAVESLOT, "Save Slots"); + /********************************************************************************* + * Support Window * + *********************************************************************************/ + DEF_STR(MSG_SUPPORT_TITLE, "Support Project64"); + DEF_STR(MSG_SUPPORT_INFO, "Project64 is a software package designed to emulate a Nintendo64 video game system on a Microsoft Windows based PC. This allows you to play real N64 software in much the same way as it would be on the original hardware system.\n\nIf you like Project64 and have gotten some value out of it then please support project64 as either a thank you, or your desire to see it continually improved.\n\nIf you have supported project64:"); + DEF_STR(MSG_SUPPORT_ENTER_CODE, "Enter notification code"); + DEF_STR(MSG_SUPPORT_PROJECT64, "Support Project64"); + DEF_STR(MSG_SUPPORT_CONTINUE, "Continue"); + DEF_STR(MSG_SUPPORT_ENTER_SUPPORT_CODE, "Please enter the support code"); + DEF_STR(MSG_SUPPORT_INCORRECT_CODE, "Incorrect support code"); + DEF_STR(MSG_SUPPORT_COMPLETE, "Thank you"); + DEF_STR(MSG_SUPPORT_ENTER_CODE_TITLE, "Enter code"); + DEF_STR(MSG_SUPPORT_ENTER_CODE_DESC, "Please enter the code in the email"); + DEF_STR(MSG_SUPPORT_OK, "OK"); + DEF_STR(MSG_SUPPORT_CANCEL, "Cancel"); + /********************************************************************************* * Messages * *********************************************************************************/ diff --git a/Source/Project64/Project64.vcproj b/Source/Project64/Project64.vcproj index 7fa698eac..cf2c68933 100644 --- a/Source/Project64/Project64.vcproj +++ b/Source/Project64/Project64.vcproj @@ -229,6 +229,14 @@ RelativePath=".\UserInterface\SettingsConfig.cpp" > + + + + @@ -459,6 +467,14 @@ RelativePath=".\UserInterface\SettingsConfig.h" > + + + + diff --git a/Source/Project64/Project64.vcxproj b/Source/Project64/Project64.vcxproj index 18cd3804f..656d31dcc 100644 --- a/Source/Project64/Project64.vcxproj +++ b/Source/Project64/Project64.vcxproj @@ -79,6 +79,8 @@ + + @@ -120,6 +122,8 @@ + + diff --git a/Source/Project64/Settings/UISettings.cpp b/Source/Project64/Settings/UISettings.cpp index 5d99bb159..de255b0c9 100644 --- a/Source/Project64/Settings/UISettings.cpp +++ b/Source/Project64/Settings/UISettings.cpp @@ -62,6 +62,8 @@ void RegisterUISettings (void) g_Settings->AddHandler((SettingID)(FirstUISettings + Directory_LastSave), new CSettingTypeApplication("Directory", "Last Save Directory", Directory_InstantSave)); g_Settings->AddHandler((SettingID)(FirstUISettings + File_RecentGameFileCount), new CSettingTypeApplication("", "Remembered Rom Files", (uint32_t)10)); g_Settings->AddHandler((SettingID)(FirstUISettings + File_RecentGameFileIndex), new CSettingTypeApplicationIndex("Recent File", "Recent Rom", Default_None)); + + g_Settings->AddHandler((SettingID)(FirstUISettings + SupportWindows_RunCount), new CSettingTypeApplication("Support Project64", "Run Count", (uint32_t)0)); } void UISettingsSaveBool(UISettingID Type, bool Value) diff --git a/Source/Project64/Settings/UISettings.h b/Source/Project64/Settings/UISettings.h index 265edafe0..ac1f8e6c3 100644 --- a/Source/Project64/Settings/UISettings.h +++ b/Source/Project64/Settings/UISettings.h @@ -58,6 +58,9 @@ enum UISettingID //Recent Game File_RecentGameFileCount, File_RecentGameFileIndex, + + //Support Window + SupportWindows_RunCount, }; void RegisterUISettings (void); diff --git a/Source/Project64/UserInterface.h b/Source/Project64/UserInterface.h index 7e56092e4..49835f761 100644 --- a/Source/Project64/UserInterface.h +++ b/Source/Project64/UserInterface.h @@ -27,3 +27,4 @@ #include "UserInterface/resource.h" #include "UserInterface/SettingsConfig.h" #include "UserInterface/CheatClassUI.h" +#include "UserInterface/SupportWindow.h" diff --git a/Source/Project64/UserInterface/SupportEnterCode.cpp b/Source/Project64/UserInterface/SupportEnterCode.cpp new file mode 100644 index 000000000..673e6dde7 --- /dev/null +++ b/Source/Project64/UserInterface/SupportEnterCode.cpp @@ -0,0 +1,61 @@ +#include "stdafx.h" +#include "SupportEnterCode.h" +#include +#include "resource.h" + +LRESULT CSupportEnterCode::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) +{ + SetWindowTextW(m_hWnd, wGS(MSG_SUPPORT_ENTER_CODE_TITLE).c_str()); + SetWindowTextW(GetDlgItem(IDOK), wGS(MSG_SUPPORT_OK).c_str()); + SetWindowTextW(GetDlgItem(IDCANCEL), wGS(MSG_SUPPORT_CANCEL).c_str()); + SetWindowTextW(GetDlgItem(IDC_DESCRIPTION), wGS(MSG_SUPPORT_ENTER_CODE_DESC).c_str()); + return TRUE; +} + +LRESULT CSupportEnterCode::OnColorStatic(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/) +{ + HDC hdcStatic = (HDC)wParam; + SetTextColor(hdcStatic, RGB(0, 0, 0)); + SetBkMode(hdcStatic, TRANSPARENT); + return (LONG)(LRESULT)((HBRUSH)GetStockObject(NULL_BRUSH)); +} + +LRESULT CSupportEnterCode::OnEraseBackground(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/) +{ + static HPEN outline = CreatePen(PS_SOLID, 1, 0x00FFFFFF); + static HBRUSH fill = CreateSolidBrush(0x00FFFFFF); + SelectObject((HDC)wParam, outline); + SelectObject((HDC)wParam, fill); + + RECT rect; + GetClientRect(&rect); + + Rectangle((HDC)wParam, rect.left, rect.top, rect.right, rect.bottom); + return TRUE; +} + +LRESULT CSupportEnterCode::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + EndDialog(wID); + return TRUE; +} + +LRESULT CSupportEnterCode::OnOkCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + char code[50]; + if (!GetDlgItemText(IDC_CODE,code,sizeof(code))) + { + MessageBoxW(m_hWnd, wGS(MSG_SUPPORT_ENTER_SUPPORT_CODE).c_str(), wGS(MSG_SUPPORT_PROJECT64).c_str(), MB_OK); + return false; + } + if (_stricmp(code,"thank you from project64") != 0) + { + MessageBoxW(m_hWnd, wGS(MSG_SUPPORT_INCORRECT_CODE).c_str(), wGS(MSG_SUPPORT_PROJECT64).c_str(), MB_OK); + return false; + } + UISettingsSaveDword(SupportWindows_RunCount, (uint32_t) -1); + CSettingTypeApplication::Flush(); + MessageBoxW(m_hWnd, wGS(MSG_SUPPORT_COMPLETE).c_str(), wGS(MSG_SUPPORT_PROJECT64).c_str(), MB_OK); + EndDialog(wID); + return TRUE; +} \ No newline at end of file diff --git a/Source/Project64/UserInterface/SupportEnterCode.h b/Source/Project64/UserInterface/SupportEnterCode.h new file mode 100644 index 000000000..c0bebfe68 --- /dev/null +++ b/Source/Project64/UserInterface/SupportEnterCode.h @@ -0,0 +1,23 @@ +#pragma once + +class CSupportEnterCode : + public CDialogImpl +{ +public: + BEGIN_MSG_MAP_EX(CSettingConfig) + MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) + MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic) + MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground) + COMMAND_ID_HANDLER(IDOK, OnOkCmd) + COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd) + END_MSG_MAP() + + enum { IDD = IDD_Support_EnterCode }; + +private: + LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); + LRESULT OnColorStatic(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled); + LRESULT OnOkCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); + LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +}; \ No newline at end of file diff --git a/Source/Project64/UserInterface/SupportWindow.cpp b/Source/Project64/UserInterface/SupportWindow.cpp new file mode 100644 index 000000000..0095d70cb --- /dev/null +++ b/Source/Project64/UserInterface/SupportWindow.cpp @@ -0,0 +1,147 @@ +#include "stdafx.h" +#include "SupportEnterCode.h" + +HWND CSupportWindow::m_hParent = NULL; +CSupportWindow * CSupportWindow::m_this = NULL; +uint32_t CSupportWindow::m_RunCount = 0; + +CSupportWindow::CSupportWindow(void) +{ +} + +CSupportWindow::~CSupportWindow(void) +{ +} + +void CALLBACK CSupportWindow::TimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) +{ + ::KillTimer(NULL, idEvent); + CSupportWindow SupportWindow; + SupportWindow.DoModal(m_hParent); +} + +void CSupportWindow::Show(HWND hParent) +{ + m_RunCount = UISettingsLoadDword(SupportWindows_RunCount); + if (m_RunCount == -1) + { + return; + } + UISettingsSaveDword(SupportWindows_RunCount, m_RunCount + 1); + + if (m_RunCount < 3) + { + return; + } + + m_hParent = hParent; + m_this = this; + ::SetTimer(NULL, 0, 2500, TimerProc); +} + +void CSupportWindow::EnableContinue() +{ + GetSystemMenu(true); + SetWindowLong(GWL_STYLE, GetWindowLong(GWL_STYLE) & ~CS_NOCLOSE); + ::EnableWindow(GetDlgItem(IDCANCEL), true); +} + +LRESULT CSupportWindow::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) +{ + SetWindowTextW(m_hWnd, wGS(MSG_SUPPORT_TITLE).c_str()); + SetWindowTextW(GetDlgItem(IDC_ENTER_CODE), wGS(MSG_SUPPORT_ENTER_CODE).c_str()); + SetWindowTextW(GetDlgItem(ID_SUPPORT_PJ64), wGS(MSG_SUPPORT_PROJECT64).c_str()); + SetWindowTextW(GetDlgItem(IDCANCEL), wGS(MSG_SUPPORT_CONTINUE).c_str()); + + { + HWND hInfo = GetDlgItem(IDC_INFO); + std::wstring InfoText = wGS(MSG_SUPPORT_INFO); + RECT rcWin = { 0 }; + ::GetClientRect(hInfo,&rcWin); + + HDC hDC = ::GetDC(hInfo); + HFONT hFont = (HFONT)::SendMessage(hInfo, WM_GETFONT, 0, 0L); + if(hFont == NULL) + { + hFont = (HFONT)::GetStockObject(SYSTEM_FONT); + } + SelectObject(hDC, hFont); + + if (DrawTextW(hDC,InfoText.c_str(),InfoText.length(),&rcWin,DT_LEFT | DT_CALCRECT | DT_WORDBREAK | DT_NOCLIP) > 0) + { + ::SetWindowPos(hInfo,NULL,0,0,rcWin.right, rcWin.bottom,SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOOWNERZORDER); + } + SetWindowTextW(hInfo, InfoText.c_str()); + + ::GetWindowRect(hInfo,&rcWin); + ::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&rcWin, 2); + ::SetWindowPos(GetDlgItem(IDC_ENTER_CODE),NULL,rcWin.left,rcWin.bottom + 4,0,0,SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOOWNERZORDER); + + m_EnterLink.SubclassWindow(GetDlgItem(IDC_ENTER_CODE)); + m_EnterLink.SetHyperLinkExtendedStyle(HLINK_COMMANDBUTTON,HLINK_COMMANDBUTTON); + } + if (m_RunCount >= 10) + { + HMENU menu = GetSystemMenu(false); + RemoveMenu(menu, SC_CLOSE, MF_BYCOMMAND); + DWORD dwStyle = GetWindowLong(GWL_STYLE); + dwStyle |= CS_NOCLOSE; + SetWindowLong(GWL_STYLE, dwStyle); + + ::EnableWindow(GetDlgItem(IDCANCEL), false); + SetTimer(0, 30000, NULL); + } + return TRUE; +} + +LRESULT CSupportWindow::OnColorStatic(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/) +{ + HDC hdcStatic = (HDC)wParam; + SetTextColor(hdcStatic, RGB(0, 0, 0)); + SetBkMode(hdcStatic, TRANSPARENT); + return (LONG)(LRESULT)((HBRUSH)GetStockObject(NULL_BRUSH)); +} + +LRESULT CSupportWindow::OnEraseBackground(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/) +{ + static HPEN outline = CreatePen(PS_SOLID, 1, 0x00FFFFFF); + static HBRUSH fill = CreateSolidBrush(0x00FFFFFF); + SelectObject((HDC)wParam, outline); + SelectObject((HDC)wParam, fill); + + RECT rect; + GetClientRect(&rect); + + Rectangle((HDC)wParam, rect.left, rect.top, rect.right, rect.bottom); + return TRUE; +} + +LRESULT CSupportWindow::OnTimer(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/) +{ + KillTimer(wParam); + EnableContinue(); + return true; +} + +LRESULT CSupportWindow::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + EndDialog(wID); + return TRUE; +} + +LRESULT CSupportWindow::OnSupportProject64(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + ShellExecute(NULL, "open", "http://www.pj64-emu.com/support-project64.html", NULL, NULL, SW_SHOWMAXIMIZED); + return TRUE; +} + +LRESULT CSupportWindow::OnEnterCode(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + CSupportEnterCode EnterCodeWindow; + EnterCodeWindow.DoModal(m_hWnd); + if (UISettingsLoadDword(SupportWindows_RunCount) == -1) + { + EndDialog(wID); + } + return TRUE; +} \ No newline at end of file diff --git a/Source/Project64/UserInterface/SupportWindow.h b/Source/Project64/UserInterface/SupportWindow.h new file mode 100644 index 000000000..63532e8e7 --- /dev/null +++ b/Source/Project64/UserInterface/SupportWindow.h @@ -0,0 +1,43 @@ +#pragma once + +class CSupportWindow : + public CDialogImpl +{ +public: + BEGIN_MSG_MAP_EX(CSettingConfig) + MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) + MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic) + MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground) + MESSAGE_HANDLER(WM_TIMER, OnTimer) + COMMAND_RANGE_HANDLER(IDOK, IDCANCEL, OnCloseCmd) + COMMAND_ID_HANDLER(ID_SUPPORT_PJ64, OnSupportProject64) + COMMAND_ID_HANDLER(IDC_ENTER_CODE, OnEnterCode) + END_MSG_MAP() + + enum { IDD = IDD_Support_Project64 }; + + CSupportWindow(void); + ~CSupportWindow(void); + + void Show(HWND hParent); + +private: + LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); + LRESULT OnColorStatic(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled); + LRESULT OnTimer(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/); + LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); + LRESULT OnSupportProject64(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); + LRESULT OnEnterCode(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); + + void EnableContinue(); + + CHyperLink m_EnterLink; + + static DWORD CALLBACK SupportWindowProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam); + static void CALLBACK TimerProc(HWND, UINT, UINT_PTR idEvent, DWORD); + + static HWND m_hParent; + static CSupportWindow * m_this; + static uint32_t m_RunCount; +}; \ No newline at end of file diff --git a/Source/Project64/UserInterface/UIResources.rc b/Source/Project64/UserInterface/UIResources.rc index 6d668f661..22db59315 100644 --- a/Source/Project64/UserInterface/UIResources.rc +++ b/Source/Project64/UserInterface/UIResources.rc @@ -639,6 +639,28 @@ BEGIN EDITTEXT IDC_NOTES_PLUGIN,80,62,132,30,ES_AUTOHSCROLL END +IDD_Support_Project64 DIALOGEX 0, 0, 233, 207 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Support Project64" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL IDB_ABOUT_LOGO,IDC_STATIC,"Static",SS_BITMAP,0,0,233,74 + DEFPUSHBUTTON "Support Project64",ID_SUPPORT_PJ64,19,186,71,14 + PUSHBUTTON "Continue",IDCANCEL,139,186,71,14 + LTEXT "Project64 is a software package",IDC_INFO,7,76,213,79 + LTEXT "Enter notification code",IDC_ENTER_CODE,8,164,213,8 +END + +IDD_Support_EnterCode DIALOGEX 0, 0, 161, 68 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Enter Code" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,50,47,50,14 + PUSHBUTTON "Cancel",IDCANCEL,104,47,50,14 + LTEXT "Please enter the code in email",IDC_DESCRIPTION,7,7,147,15 + EDITTEXT IDC_CODE,7,25,147,12,ES_AUTOHSCROLL +END ///////////////////////////////////////////////////////////////////////////// // @@ -876,6 +898,22 @@ BEGIN TOPMARGIN, 4 BOTTOMMARGIN, 152 END + + IDD_Support_Project64, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 170 + TOPMARGIN, 7 + BOTTOMMARGIN, 200 + END + + IDD_Support_EnterCode, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 154 + TOPMARGIN, 7 + BOTTOMMARGIN, 61 + END END #endif // APSTUDIO_INVOKED diff --git a/Source/Project64/UserInterface/resource.h b/Source/Project64/UserInterface/resource.h index 8bcf9ce73..e5dcff08b 100644 --- a/Source/Project64/UserInterface/resource.h +++ b/Source/Project64/UserInterface/resource.h @@ -38,6 +38,8 @@ #define IDD_Settings_General 144 #define IDD_Settings_Accelerator 145 #define IDD_Settings_Config 149 +#define IDD_Support_Project64 150 +#define IDD_Support_EnterCode 151 #define IDR_POPUP 155 #define IDR_CHEAT_MENU 160 #define IDD_Lang_Select 161 @@ -238,10 +240,14 @@ #define IDC_BORDER 1099 #define IDC_CONT_NAME 1100 #define IDC_COUNTPERBYTE 1100 +#define ID_SUPPORT_PJ64 1100 #define IDC_DIR_FRAME1 1101 #define IDC_ROM_FASTSP 1101 +#define IDC_INFO 1101 #define IDC_AUDIO_SIGNAL 1102 #define IDC_DIR_TEXTURE_FRAME 1102 +#define IDC_ENTER_CODE 1102 +#define IDC_DESCRIPTION 1102 #define IDC_DIR_FRAME3 1103 #define IDC_DIR_FRAME4 1104 #define IDC_DIR_FRAME5 1105 @@ -348,9 +354,9 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 150 +#define _APS_NEXT_RESOURCE_VALUE 152 #define _APS_NEXT_COMMAND_VALUE 40009 -#define _APS_NEXT_CONTROL_VALUE 1100 +#define _APS_NEXT_CONTROL_VALUE 1104 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/Source/Project64/main.cpp b/Source/Project64/main.cpp index 4b2afb963..e79341419 100644 --- a/Source/Project64/main.cpp +++ b/Source/Project64/main.cpp @@ -20,6 +20,7 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR / CMainMenu MainMenu(&MainWindow); g_Plugins->SetRenderWindows(&MainWindow, &HiddenWindow); Notify().SetMainWindow(&MainWindow); + CSupportWindow SupportWindow; if (g_Settings->LoadStringVal(Cmd_RomFile).length() > 0) { @@ -63,6 +64,7 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR / } else { + SupportWindow.Show(reinterpret_cast(MainWindow.GetWindowHandle())); if (UISettingsLoadBool(RomBrowser_Enabled)) { WriteTrace(TraceUserInterface, TraceDebug, "Show Rom Browser");