Skip to content

Commit

Permalink
Merge branch 'OpenStickCommunity:main' into NewPicoSDK
Browse files Browse the repository at this point in the history
  • Loading branch information
Fortinbra authored Jan 8, 2025
2 parents 4dcb01e + 0e6e0b8 commit 9aceb10
Show file tree
Hide file tree
Showing 14 changed files with 285 additions and 203 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
GP2040_BOARDCONFIG: [ARCController, Blank, Pico, PicoW, BentoBox, ergoSHIFTRev2, FightboardV3, FightboardV3Mirrored, FlatboxRev4, FlatboxRev5, FlatboxRev5RGB, FlatboxRev5USBPassthrough, FlatboxRev5Southpaw, Granola, KB2040, KeyboardConverter, Haute42COSMOX, Liatris, MavercadeRev1, MavercadeRev2, MiSTercadeV2, OpenCore0, OpenCore0WASD, OSUMGP-RP2040, PicoAnn, PicoFightingBoard, PXPGamepad, RanaTadpole, ReflexCtrlGenesis6, ReflexCtrlNES, ReflexCtrlSaturn, ReflexCtrlSNES, ReflexCtrlVB, ReflexEncodeV1.2, ReflexEncodeV2.0, RP2040AdvancedBreakoutBoard, RP2040AdvancedBreakoutBoardUSBPassthrough, RP2040MiniBreakoutBoard, SparkFunProMicro, WaveshareZero, Stress, SGFDevices, ZeroRhythm]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4.1.1

Expand Down
Binary file modified configs/Granola/assets/granola-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified configs/Granola/assets/granola-raindrop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified configs/Granola/assets/granola-summit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified configs/Granola/assets/granola-trailmix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified configs/OSUMGP-RP2040/osumgp-rp2040_0.4b-real.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 35 additions & 7 deletions src/config_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,34 @@
#define DEFAULT_PS4_ID_MODE PS4_ID_CONSOLE
#endif

#ifndef DEFAULT_USB_DESC_OVERRIDE
#define DEFAULT_USB_DESC_OVERRIDE false
#endif

#ifndef DEFAULT_USB_DESC_PRODUCT
#define DEFAULT_USB_DESC_PRODUCT "GP2040-CE (Custom)"
#endif

#ifndef DEFAULT_USB_DESC_MANUFACTURER
#define DEFAULT_USB_DESC_MANUFACTURER "Open Stick Community"
#endif

#ifndef DEFAULT_USB_DESC_VERSION
#define DEFAULT_USB_DESC_VERSION "1.0"
#endif

#ifndef DEFAULT_USB_ID_OVERRIDE
#define DEFAULT_USB_ID_OVERRIDE false
#endif

#ifndef DEFAULT_USB_VENDOR_ID
#define DEFAULT_USB_VENDOR_ID 0x10C4
#endif

#ifndef DEFAULT_USB_PRODUCT_ID
#define DEFAULT_USB_PRODUCT_ID 0x82C0
#endif

#ifndef GPIO_PIN_00
#define GPIO_PIN_00 GpioAction::NONE
#endif
Expand Down Expand Up @@ -277,13 +305,13 @@ void ConfigUtils::initUnsetPropertiesWithDefaults(Config& config)
INIT_UNSET_PROPERTY(config.gamepadOptions, ps5AuthType, DEFAULT_PS5AUTHENTICATION_TYPE);
INIT_UNSET_PROPERTY(config.gamepadOptions, xinputAuthType, DEFAULT_XINPUTAUTHENTICATION_TYPE);
INIT_UNSET_PROPERTY(config.gamepadOptions, ps4ControllerIDMode, DEFAULT_PS4_ID_MODE);
INIT_UNSET_PROPERTY(config.gamepadOptions, usbDescOverride, false);
INIT_UNSET_PROPERTY_STR(config.gamepadOptions, usbDescProduct, "GP2040-CE (Custom)");
INIT_UNSET_PROPERTY_STR(config.gamepadOptions, usbDescManufacturer, "Open Stick Community");
INIT_UNSET_PROPERTY_STR(config.gamepadOptions, usbDescVersion, "1.0");
INIT_UNSET_PROPERTY(config.gamepadOptions, usbOverrideID, false);
INIT_UNSET_PROPERTY(config.gamepadOptions, usbVendorID, 0x10C4);
INIT_UNSET_PROPERTY(config.gamepadOptions, usbProductID, 0x82C0);
INIT_UNSET_PROPERTY(config.gamepadOptions, usbDescOverride, DEFAULT_USB_DESC_OVERRIDE);
INIT_UNSET_PROPERTY_STR(config.gamepadOptions, usbDescProduct, DEFAULT_USB_DESC_PRODUCT);
INIT_UNSET_PROPERTY_STR(config.gamepadOptions, usbDescManufacturer, DEFAULT_USB_DESC_MANUFACTURER);
INIT_UNSET_PROPERTY_STR(config.gamepadOptions, usbDescVersion, DEFAULT_USB_DESC_VERSION);
INIT_UNSET_PROPERTY(config.gamepadOptions, usbOverrideID, DEFAULT_USB_ID_OVERRIDE);
INIT_UNSET_PROPERTY(config.gamepadOptions, usbVendorID, DEFAULT_USB_VENDOR_ID);
INIT_UNSET_PROPERTY(config.gamepadOptions, usbProductID, DEFAULT_USB_PRODUCT_ID);

// hotkeyOptions
HotkeyOptions& hotkeyOptions = config.hotkeyOptions;
Expand Down
Binary file modified www/public/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 10 additions & 14 deletions www/src/Components/Navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,19 @@ const Navigation = () => {
let eventKey = 0;

return (
<Navbar
collapseOnSelect
bg="primary"
variant="dark"
expand="md"
fixed="top"
>
<Navbar.Brand href="/" title={`GP2040-CE ${t('Navigation:home-label')}`}>
<img
src="images/logo.png"
className="title-logo"
alt="GP2040-CE logo"
/>{' '}
<Navbar collapseOnSelect expand="md" fixed="top">
<Navbar.Brand title={`GP2040-CE ${t('Navigation:home-label')}`}>
<Nav.Link as={NavLink} to="/" eventKey={eventKey++}>
<img
src="images/logo.png"
className="title-logo"
alt="GP2040-CE logo"
/>
</Nav.Link>
</Navbar.Brand>
<Navbar.Toggle aria-controls="responsive-navbar-nav" />
<Navbar.Collapse id="basic-navbar-nav">
<Nav className="me-auto">
<Nav className="me-auto nav-menu">
<Nav.Link as={NavLink} to="/settings" eventKey={eventKey++}>
{t('Navigation:settings-label')}
</Nav.Link>
Expand Down
21 changes: 16 additions & 5 deletions www/src/Components/Navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ $nav-outer-margin: 0.75rem;

nav.navbar {
padding: 0;
background-color: white;
box-shadow: 0 1px 2px 0 #0000001a;

.navbar-brand {
margin-right: $nav-outer-margin;
Expand All @@ -30,17 +32,17 @@ nav.navbar {
color: #ff0000;
}
}
[data-bs-theme="dark"] {
nav.navbar {
background-color: #242526;
}
}

.title-logo {
height: 40px;
margin: 0.25rem 0rem 0.25rem $nav-outer-margin;
}

.nav-link,
.nav-item * {
font-size: 0.875rem;
}

@media (max-width: 767.98px) {
nav.navbar {
.navbar-actions {
Expand All @@ -51,5 +53,14 @@ nav.navbar {
.nav-link {
margin-left: $nav-outer-margin;
}
.nav-menu {
.dropdown-menu {
background-color: transparent;
border: none;
.dropdown-item {
padding-left: 1.5rem;
}
}
}
}
}
63 changes: 22 additions & 41 deletions www/src/Pages/InputMacroAddonPage.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import React, { useContext, useEffect, useState } from 'react';
import { AppContext } from '../Contexts/AppContext';
import {
Badge,
Button,
Col,
Form,
InputGroup,
Nav,
OverlayTrigger,
Row,
Tab,
Table,
Tooltip,
} from 'react-bootstrap';
import { Formik, useFormikContext } from 'formik';
import * as yup from 'yup';
import { Trans, useTranslation } from 'react-i18next';
import omit from 'lodash/omit';

import { AppContext } from '../Contexts/AppContext';
import Section from '../Components/Section';
import WebApi from '../Services/WebApi';
import {
Expand Down Expand Up @@ -83,11 +81,8 @@ const defaultValues = {
const ONE_FRAME_US = 16666;

const FormContext = () => {
const { values, setValues } = useFormikContext();
const { buttonLabels, setLoading } = useContext(AppContext);
const { buttonLabelType, swapTpShareLabels } = buttonLabels;

const CURRENT_BUTTONS = getButtonLabels(buttonLabelType, swapTpShareLabels);
const { setValues } = useFormikContext();
const { setLoading } = useContext(AppContext);

useEffect(() => {
async function fetchData() {
Expand Down Expand Up @@ -132,8 +127,6 @@ const ButtonMasksComponent = (props) => {
);
};

const tooltip = <Tooltip id="tooltip">Double click to delete.</Tooltip>;

const MacroInputComponent = (props) => {
const {
value: { duration, buttonMask, waitDuration },
Expand All @@ -147,8 +140,8 @@ const MacroInputComponent = (props) => {
} = props;

return (
<Row className="align-content-start align-items-center row-gap-2 pb-2">
<Col xs="auto" style={{ width: 180 }}>
<Row className="align-content-start align-items-center row-gap-2 gx-2 pb-2">
<Col xs="auto" style={{ width: 150 }}>
<InputGroup size="sm">
<Form.Control
className="text-center"
Expand Down Expand Up @@ -244,19 +237,9 @@ const MacroInputComponent = (props) => {
</InputGroup>
</Col>
<Col xs="auto">
<OverlayTrigger
placement="right"
overlay={tooltip}
delay={{ show: 500, hide: 100 }}
>
<Button
variant="transparent"
size="sm"
onDoubleClick={deleteMacroInput}
>
💥
</Button>
</OverlayTrigger>
<Button size="sm" onClick={deleteMacroInput}>
{'✕'}
</Button>
</Col>
</Row>
);
Expand Down Expand Up @@ -437,22 +420,20 @@ const MacroComponent = (props) => {
/>
</Col>
</Row>
<Row>
{macroInputs.map((macroInput, a) => (
<MacroInputComponent
key={`${key}.macroInputs[${a}]`}
id={`${key}.macroInputs[${a}]`}
value={macroInput}
errors={errors?.macroInputs?.at(a)}
showFrames={showFrames}
translation={t}
buttonLabelType={buttonLabelType}
deleteMacroInput={() => deleteMacroInput(a)}
handleChange={handleChange}
setFieldValue={setFieldValue}
/>
))}
</Row>
{macroInputs.map((macroInput, a) => (
<MacroInputComponent
key={`${key}.macroInputs[${a}]`}
id={`${key}.macroInputs[${a}]`}
value={macroInput}
errors={errors?.macroInputs?.at(a)}
showFrames={showFrames}
translation={t}
buttonLabelType={buttonLabelType}
deleteMacroInput={() => deleteMacroInput(a)}
handleChange={handleChange}
setFieldValue={setFieldValue}
/>
))}
<Row>
<Col sm={3}>
{macroInputs.length < MACRO_INPUTS_MAX ? (
Expand Down
Loading

0 comments on commit 9aceb10

Please sign in to comment.