mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
Add wiimote tas input.
This commit is contained in:
@ -9,12 +9,14 @@
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/event.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/toplevel.h>
|
||||
#include <wx/translation.h>
|
||||
#include <wx/windowid.h>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
|
||||
#include "InputCommon/GCPadStatus.h"
|
||||
|
||||
class wxCheckBox;
|
||||
@ -27,72 +29,89 @@ class TASInputDlg : public wxDialog
|
||||
{
|
||||
public:
|
||||
TASInputDlg(wxWindow* parent,
|
||||
wxWindowID id = 1,
|
||||
const wxString& title = _("TAS Input"),
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE | wxSTAY_ON_TOP);
|
||||
wxWindowID id = 1,
|
||||
const wxString& title = _("TAS Input"),
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE | wxSTAY_ON_TOP);
|
||||
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
void UpdateFromSliders(wxCommandEvent& event);
|
||||
void UpdateFromText(wxCommandEvent& event);
|
||||
void OnMouseDownL(wxMouseEvent& event);
|
||||
void OnMouseUpR(wxMouseEvent& event);
|
||||
void OnRightClickSlider(wxMouseEvent& event);
|
||||
void ResetValues();
|
||||
void GetValues(GCPadStatus* PadStatus, int controllerID);
|
||||
void GetValues(GCPadStatus* PadStatus);
|
||||
void GetValues(u8* data, WiimoteEmu::ReportFeatures rptf);
|
||||
void SetTurbo(wxMouseEvent& event);
|
||||
void SetTurboFalse(wxMouseEvent& event);
|
||||
void SetTurboState(wxCheckBox* CheckBox, bool* TurboOn);
|
||||
void ButtonTurbo();
|
||||
void GetKeyBoardInput(GCPadStatus* PadStatus);
|
||||
void GetKeyBoardInput(u8* data, WiimoteEmu::ReportFeatures rptf);
|
||||
bool TextBoxHasFocus();
|
||||
void SetLandRTriggers();
|
||||
bool TASHasFocus();
|
||||
|
||||
void CreateGCLayout();
|
||||
void CreateWiiLayout();
|
||||
wxBitmap CreateStickBitmap(int x, int y);
|
||||
void SetWiiButtons(wm_core* butt);
|
||||
void GetIRData(u8* const data, u8 mode, bool use_accel);
|
||||
|
||||
private:
|
||||
u8 mainX, mainY, cX, cY, lTrig, rTrig;
|
||||
const int ID_C_STICK = 1001;
|
||||
const int ID_MAIN_STICK = 1002;
|
||||
int eleID = 1003;
|
||||
|
||||
enum
|
||||
struct Control
|
||||
{
|
||||
ID_MAIN_X_SLIDER = 1000,
|
||||
ID_MAIN_X_TEXT,
|
||||
ID_MAIN_Y_SLIDER,
|
||||
ID_MAIN_Y_TEXT,
|
||||
ID_C_X_SLIDER,
|
||||
ID_C_X_TEXT,
|
||||
ID_C_Y_SLIDER,
|
||||
ID_C_Y_TEXT,
|
||||
ID_L_SLIDER,
|
||||
ID_L_TEXT,
|
||||
ID_R_SLIDER,
|
||||
ID_R_TEXT,
|
||||
ID_CLOSE,
|
||||
ID_UP,
|
||||
ID_DOWN,
|
||||
ID_LEFT,
|
||||
ID_RIGHT,
|
||||
ID_A,
|
||||
ID_B,
|
||||
ID_X,
|
||||
ID_Y,
|
||||
ID_Z,
|
||||
ID_L,
|
||||
ID_R,
|
||||
ID_START,
|
||||
ID_MAIN_STICK,
|
||||
ID_C_STICK,
|
||||
wxTextCtrl* Text;
|
||||
wxSlider* Slider;
|
||||
int value = -1;
|
||||
int Text_ID;
|
||||
int Slider_ID;
|
||||
u32 range;
|
||||
u32 defaultValue = 128;
|
||||
bool SetByKeyboard = false;
|
||||
};
|
||||
|
||||
wxSlider *wx_mainX_s, *wx_mainY_s, *wx_cX_s, *wx_cY_s, *wx_l_s, *wx_r_s;
|
||||
wxCheckBox *wx_up_button, *wx_down_button, *wx_left_button, *wx_right_button, *wx_a_button, *wx_b_button, *wx_x_button, *wx_y_button, *wx_l_button, *wx_r_button, *wx_z_button, *wx_start_button;
|
||||
wxTextCtrl *wx_mainX_t, *wx_mainY_t, *wx_cX_t, *wx_cY_t, *wx_l_t, *wx_r_t;
|
||||
wxMemoryDC dc_main, dc_c;
|
||||
wxStaticBitmap *static_bitmap_main, *static_bitmap_c;
|
||||
wxBitmap bitmap;
|
||||
bool A_turbo,B_turbo, X_turbo, Y_turbo, Z_turbo, L_turbo, R_turbo, START_turbo,DL_turbo,DR_turbo,DD_turbo,DU_turbo;
|
||||
bool A_cont,B_cont, X_cont, Y_cont, Z_cont, L_cont, L_button_cont, R_cont, R_button_cont, START_cont,DL_cont,DR_cont,DD_cont,DU_cont,mstickx,msticky,cstickx,csticky;
|
||||
int xaxis,yaxis,c_xaxis,c_yaxis,update,update_axis;
|
||||
struct Button
|
||||
{
|
||||
wxCheckBox* Checkbox;
|
||||
bool SetByKeyboard = false;
|
||||
bool TurboOn = false;
|
||||
int ID;
|
||||
};
|
||||
|
||||
struct Stick
|
||||
{
|
||||
wxStaticBitmap* bitmap;
|
||||
Control xCont;
|
||||
Control yCont;
|
||||
};
|
||||
|
||||
void SetStickValue(bool* ActivatedByKeyboard, int* AmountPressed, wxTextCtrl* Textbox, int CurrentValue, int center = 128);
|
||||
void SetButtonValue(Button* button, bool CurrentState);
|
||||
void SetSliderValue(Control* control, int CurrentValue, int defaultValue = 128);
|
||||
Stick CreateStick(int id_stick);
|
||||
wxStaticBoxSizer* CreateStickLayout(Stick* tempStick, std::string title);
|
||||
Button CreateButton(const std::string& name);
|
||||
Control CreateControl(long style, int width, int height, u32 range = 255);
|
||||
|
||||
Control lCont, rCont, xCont, yCont, zCont;
|
||||
Button A, B, X, Y, Z, L, R, C, START, PLUS, MINUS, ONE, TWO, HOME, dpad_up, dpad_down, dpad_left, dpad_right;
|
||||
Stick MainStick, CStick;
|
||||
|
||||
Button* Buttons[14];
|
||||
Control* Controls[10];
|
||||
static const int GCPadButtonsBitmask[12];
|
||||
static const int WiiButtonsBitmask[13];
|
||||
|
||||
bool hasLayout = false;
|
||||
bool isWii = false;
|
||||
|
||||
wxGridSizer* const buttons_dpad = new wxGridSizer(3);
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
Reference in New Issue
Block a user