Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
115 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,5 @@ typedef struct | |
BUTTON R_ANALOG; | ||
uint8_t Range; | ||
uint8_t DeadZone; | ||
bool RealN64Range; | ||
} N64CONTROLLER; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#include "OptionsUI.h" | ||
#include "wtl.h" | ||
#include "resource.h" | ||
#include <Common\StdString.h> | ||
|
||
class COptionsDlg : | ||
public CDialogImpl<COptionsDlg> | ||
{ | ||
public: | ||
enum { IDD = IDD_Options }; | ||
|
||
BEGIN_MSG_MAP(COptionsDlg) | ||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) | ||
COMMAND_ID_HANDLER(IDOK, OnOkCmd) | ||
COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd) | ||
END_MSG_MAP() | ||
|
||
COptionsDlg(uint32_t ControlIndex, CONTROL & ControlInfo, N64CONTROLLER & Controller) : | ||
m_ControlIndex(ControlIndex), | ||
m_ControlInfo(ControlInfo), | ||
m_Controller(Controller) | ||
{ | ||
} | ||
|
||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) | ||
{ | ||
CenterWindow(GetParent()); | ||
SetWindowText(stdstr_f("Options - Player %d", m_ControlIndex + 1).ToUTF16().c_str()); | ||
CButton(GetDlgItem(IDC_REAL_N64_RANGE)).SetCheck(m_Controller.RealN64Range ? BST_CHECKED : BST_UNCHECKED); | ||
return TRUE; | ||
} | ||
LRESULT OnOkCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) | ||
{ | ||
bool bChanged = false; | ||
bool RealN64Range = CButton(GetDlgItem(IDC_REAL_N64_RANGE)).GetCheck() == BST_CHECKED; | ||
if (RealN64Range != m_Controller.RealN64Range) | ||
{ | ||
m_Controller.RealN64Range = RealN64Range; | ||
bChanged = true; | ||
} | ||
if (bChanged) | ||
{ | ||
GetParent().SendMessage(PSM_CHANGED); | ||
} | ||
EndDialog(wID); | ||
return 0; | ||
} | ||
LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) | ||
{ | ||
EndDialog(wID); | ||
return 0; | ||
} | ||
uint32_t m_ControlIndex; | ||
CONTROL & m_ControlInfo; | ||
N64CONTROLLER & m_Controller; | ||
}; | ||
|
||
void ConfigOption(uint32_t ControlIndex, CONTROL & ControlInfo, N64CONTROLLER & Controller) | ||
{ | ||
COptionsDlg(ControlIndex, ControlInfo, Controller).DoModal(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma once | ||
#include <Common\stdtypes.h> | ||
#include "ControllerSpec1.1.h" | ||
#include "N64Controller.h" | ||
|
||
void ConfigOption(uint32_t ControlIndex, CONTROL & ControlInfo, N64CONTROLLER & Controller); |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.