mirror of
https://github.com/chenasraf/mudblock.git
synced 2026-05-17 17:48:05 +00:00
feat: add 1-button movement preset
This commit is contained in:
@@ -381,3 +381,49 @@ final movementPreset = GameButtonSetData(
|
||||
],
|
||||
);
|
||||
|
||||
final oneBtnMovementPreset = GameButtonSetData(
|
||||
id: uuid(),
|
||||
name: '1-Button Movement',
|
||||
type: GameButtonSetType.grid,
|
||||
crossAxisCount: 3,
|
||||
alignment: Alignment.bottomRight,
|
||||
buttons: [
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
GameButtonData(
|
||||
id: uuid(),
|
||||
label: GameButtonLabelData(
|
||||
icon: Icons.gamepad_rounded,
|
||||
iconName: 'gamepad_rounded',
|
||||
),
|
||||
pressAction: MUDAction('look'),
|
||||
labelUp: GameButtonLabelData(
|
||||
icon: Icons.keyboard_arrow_up,
|
||||
iconName: 'keyboard_arrow_up',
|
||||
),
|
||||
dragUpAction: MUDAction('north'),
|
||||
labelDown: GameButtonLabelData(
|
||||
icon: Icons.keyboard_arrow_down,
|
||||
iconName: 'keyboard_arrow_down',
|
||||
),
|
||||
dragDownAction: MUDAction('south'),
|
||||
labelLeft: GameButtonLabelData(
|
||||
icon: Icons.keyboard_arrow_left,
|
||||
iconName: 'keyboard_arrow_left',
|
||||
),
|
||||
dragLeftAction: MUDAction('west'),
|
||||
labelRight: GameButtonLabelData(
|
||||
icon: Icons.keyboard_arrow_right,
|
||||
iconName: 'keyboard_arrow_right',
|
||||
),
|
||||
dragRightAction: MUDAction('east'),
|
||||
),
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
@@ -36,6 +36,10 @@ class ButtonSetListPage extends StatelessWidget with GameStoreMixin {
|
||||
value: 'navigation_preset',
|
||||
child: Text('Create: Navigation Preset'),
|
||||
),
|
||||
const PopupMenuItem(
|
||||
value: '1_btn_navigation_preset',
|
||||
child: Text('Create: 1-Button Navigation Preset'),
|
||||
),
|
||||
];
|
||||
},
|
||||
onSelected: (value) async {
|
||||
@@ -52,6 +56,17 @@ class ButtonSetListPage extends StatelessWidget with GameStoreMixin {
|
||||
store.currentProfile.loadButtonSets();
|
||||
}
|
||||
break;
|
||||
case '1_btn_navigation_preset':
|
||||
final data = await Navigator.pushNamed(
|
||||
context,
|
||||
Paths.buttonSet,
|
||||
arguments: oneBtnMovementPreset,
|
||||
);
|
||||
if (data != null) {
|
||||
store.currentProfile.saveButtonSet(data as GameButtonSetData);
|
||||
store.currentProfile.loadButtonSets();
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user