Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iota97 committed Jan 6, 2021
1 parent f15acea commit 729aaf4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
4 changes: 1 addition & 3 deletions Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct ConfigSetting {
BoolDefaultCallback b;
IntDefaultCallback i;
Uint32DefaultCallback u;
Uint32DefaultCallback lu;
Uint64DefaultCallback lu;
FloatDefaultCallback f;
StringDefaultCallback s;
TouchPosDefaultCallback touchPos;
Expand Down Expand Up @@ -371,8 +371,6 @@ struct ConfigSetting {
const char *ini2_;
const char *ini3_;
const char *ini4_;
const char *ini5_;
const char *ini6_;
Type type_;
bool report_;
bool save_;
Expand Down
20 changes: 8 additions & 12 deletions UI/ComboKeyMappingScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,11 @@

#include "UI/ComboKeyMappingScreen.h"

class ButtonPreview : public MultiTouchButton {
class ButtonPreview : public UI::View {
public:
ButtonPreview(ImageID bgImg, ImageID img, float rotationIcon, bool flipShape, float rotationShape, int x, int y)
: MultiTouchButton(bgImg, bgImg, img, 1.0f, new UI::AnchorLayoutParams(x, y, UI::NONE, UI::NONE, true)),
x_(x), y_(y), rotI_(rotationIcon), bgImg_(bgImg), img_(img), flipS_(flipShape), rotS_(rotationShape) {
}
bool IsDown() override {
return false;
}
: View(new UI::AnchorLayoutParams(x, y, UI::NONE, UI::NONE, true)), bgImg_(bgImg), img_(img), rotI_(rotationIcon),
flipS_(flipShape), rotS_(rotationShape), x_(x), y_(y) {}

void Draw(UIContext &dc) override {
float opacity = g_Config.iTouchButtonOpacity / 100.0f;
Expand Down Expand Up @@ -153,16 +149,12 @@ void ComboKeyScreen::CreateViews() {
leftColumn->Add(new Choice(di->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
root__->Add(rightScroll_);

const int cellSize = 400;
UI::GridLayoutSettings gridsettings(cellSize, 64, 5);
gridsettings.fillCells = true;
LinearLayout *vertLayout = new LinearLayout(ORIENT_VERTICAL);
rightScroll_->Add(vertLayout);

vertLayout->Add(new ItemHeader(co->T("Button Style")));
vertLayout->Add(new CheckBox(show, co->T("Visible")));


// All icon and name are defined in GamepadEmu.h
static const char *imageNames[ARRAY_SIZE(comboKeyImages)];
for (int i = 0; i < ARRAY_SIZE(imageNames); ++i) {
Expand All @@ -181,8 +173,12 @@ void ComboKeyScreen::CreateViews() {
vertLayout->Add(new ItemHeader(co->T("Button Binding")));
vertLayout->Add(new CheckBox(&(cfg->toggle), co->T("Toggle mode")));

// Button name, image and action are defined in GamepadEmu.h
const int cellSize = 400;
UI::GridLayoutSettings gridsettings(cellSize, 64, 5);
gridsettings.fillCells = true;
GridLayout *grid = vertLayout->Add(new GridLayout(gridsettings, new LayoutParams(FILL_PARENT, WRAP_CONTENT)));

// Button name, image and action are defined in GamepadEmu.h
for (int i = 0; i < ARRAY_SIZE(comboKeyList); ++i) {
LinearLayout *row = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
row->SetSpacing(0);
Expand Down
2 changes: 1 addition & 1 deletion UI/ComboKeyMappingScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class ComboKeyScreen : public UIDialogScreenWithBackground {
void onFinish(DialogResult result) override;
UI::EventReturn onCombo(UI::EventParams &e);
private:

void saveArray();

bool array[ARRAY_SIZE(CustomKey::comboKeyList)];
int id_;
UI::ChoiceStrip *comboselect;
Expand Down
3 changes: 1 addition & 2 deletions UI/GamepadEmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "Core/Core.h"
#include "Core/System.h"
#include "Core/HLE/sceCtrl.h"
#include "Core/KeyMap.h"
#include "UI/GamepadEmu.h"

static u32 GetButtonColor() {
Expand Down Expand Up @@ -741,7 +740,7 @@ UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause, EmuScreen* e
g_Config.iTouchButtonStyle == 0 ? comboKeyShapes[cfg.shape].i : comboKeyShapes[cfg.shape].l, comboKeyShapes[cfg.shape].i,
comboKeyImages[cfg.image].i, touch.scale, buttonLayoutParams(touch)));
aux->SetAngle(comboKeyImages[cfg.image].r, comboKeyShapes[cfg.shape].r);
aux->FlipImageH(comboKeyShapes[cfg.image].f);
aux->FlipImageH(comboKeyShapes[cfg.shape].f);
return aux;
}
return nullptr;
Expand Down

0 comments on commit 729aaf4

Please sign in to comment.