Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/hotkeys rebase #318

Draft
wants to merge 39 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ff9c9ad
add hotkeybuild1
Rampoina Jul 15, 2022
e9b7712
Add building and unit hotkeys
Rampoina Jul 15, 2022
5783db3
Check the number of shared commands before trying to click from a hotkey
Rampoina Jul 18, 2022
f322a3e
Add command grid hotkeys to the default hotkeys
Rampoina Jul 18, 2022
2cd190d
Retabulate (use only tabs)
Rampoina Jul 18, 2022
c3e8a25
Update commonCommands for a uniform selection
Rampoina Jul 21, 2022
1922522
Rename commonCommands to numberCommands
Rampoina Jul 21, 2022
3313f18
Rename HotKeyBuildN to CommandKeyN
Rampoina Jul 21, 2022
9276fae
Update the GUI immediately after calling the command from a hotkey
Rampoina Jul 21, 2022
c549a6b
Correctly update numberCommands
Rampoina Jul 21, 2022
c4caa6b
Display hotkey on hover
Rampoina Jul 21, 2022
7945fa8
Remove key conflics
Rampoina Jul 23, 2022
e209dcb
Fix numberCommands
Rampoina Aug 2, 2022
46d5904
Bump Command Keys to 12
Rampoina Aug 2, 2022
f1e4a1b
feat: standart for cammand grid
Aug 11, 2022
f2b8d76
fix: if two build buttons, move second to basics
Aug 12, 2022
5523bba
refactor: command sorting code
Aug 12, 2022
e277c47
Add key mappings to docs
Jammyjamjamman Aug 9, 2022
a5438f6
Use the cancel icon for the unused grid locations
Rampoina Aug 11, 2022
afc2619
refactor: remove some useless code,
Aug 16, 2022
ea3ede3
refactor: remove incompatible code,
Aug 16, 2022
aec7bf5
fix: reset command position for build commands
Aug 16, 2022
8caa800
fix: reset command position for non-target commands
Aug 16, 2022
d5f15d2
Revert "refactor: remove some useless code,"
Aug 18, 2022
ebb0a5c
Merge pull request #4 from pavanvo/feat/hotkeys_rebase
Rampoina Aug 18, 2022
5b443a4
.github/workflows/cmake.yml:cancel in progress jobs if newer job is s…
andy5995 Aug 14, 2022
c4c426e
workflows/cmake.yml:add tests for recent gcc versions;migrate to chec…
andy5995 Aug 20, 2022
b9ac40d
Fix unit/building progress not getting restored when loading a game
Rampoina Aug 10, 2022
02478ea
Load the game on double click on the loading menu
Rampoina Aug 9, 2022
085edd2
Add missing check for the selected button
Rampoina Aug 14, 2022
339ff32
fix: check if unit have too match commands
Aug 28, 2022
78a3eb1
fix: if every basic command more than one time
Aug 28, 2022
a0c8383
refactor: remove some useles code
Aug 28, 2022
1c1dd0a
refactor: empty positions
Aug 30, 2022
d3c19ce
fix: non-uniform selection
Sep 2, 2022
00b918a
refactor: saving lines
Sep 11, 2022
e0fa247
feat: possibility to reorder command classes
Sep 11, 2022
f98a3d9
feat: add writeCommandRow method
Sep 11, 2022
979e65d
fix: add command classes to all configs
Sep 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: CMake
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

on:
push:
Expand All @@ -12,49 +15,46 @@ jobs:
fail-fast: false
matrix:
arch: [x64]
os: [ubuntu-18.04, ubuntu-latest]
os: [ubuntu-20.04, ubuntu-22.04]
compiler: [gcc, clang]
runs-on: ${{ matrix.os }}

env:
MATRIX_COMPILER: ${{matrix.compiler}}
MATRIX_OS: ${{matrix.os}}
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3
- name: Get dependencies
run: |
sudo apt update
sudo apt-get update && sudo apt-get upgrade
sudo mk/linux/setupBuildDeps.sh

- name: Bulid MegaGlest With GCC Compiler
if: ${{ matrix.compiler == 'gcc' }}
env:
CC: gcc
CXX: g++
run: mk/linux/build-mg.sh
- name: Build
run: |
if [ "${MATRIX_COMPILER}" = "clang" ]; then
EXTRA_OPTS="-f"
fi
mk/linux/build-mg.sh -m -d ${EXTRA_OPTS}
make -C mk/linux/build -j$(nproc) VERBOSE=1

- name: Bulid MegaGlest With Clang Compiler
if: ${{ matrix.compiler == 'clang' }}
env:
CC: clang
CXX: clang++
run: mk/linux/build-mg.sh

- name: Prepare Snapshot
if: ${{ matrix.compiler == 'gcc' && matrix.os == 'ubuntu-latest' }}
build-linux-other:
strategy:
fail-fast: false
matrix:
compiler: [10, 12] # 11 is on 22.04 by default, tested above
runs-on: ubuntu-22.04
env:
CC: gcc-${{matrix.compiler}}
CXX: g++-${{matrix.compiler}}
steps:
- uses: actions/checkout@v3
- name: Get dependencies
run: |
cp mk/shared/*.ini mk/linux/
strip -g mk/linux/megaglest mk/linux/megaglest_editor mk/linux/megaglest_g3dviewer

- name: Create Mega Glest Snapshot
if: ${{ matrix.compiler == 'gcc' && matrix.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v2
with:
name: megaglest-${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.compiler }}
path: |
mk/linux/megaglest
mk/linux/megaglest_editor
mk/linux/megaglest_g3dviewer
mk/linux/*.ini
!mk/linux/glest-dev.ini
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install -y $CXX
sudo mk/linux/setupBuildDeps.sh
- name: Build
run: |
mk/linux/build-mg.sh -d -m
make -C mk/linux/build -j$(nproc) VERBOSE=1

build-win64:
# The CMake configure and build commands are platform agnostic and should work equally
Expand All @@ -72,16 +72,16 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Cache Vcpkg Libs
uses: actions/cache@v2
env:
cache-name: cache-vcpkg-deps
with:
path: c:/vcpkg/installed
key: vcpkg-deps

- name: Install Dependencies
run: |
vcpkg integrate install
Expand Down Expand Up @@ -121,15 +121,15 @@ jobs:
- name: Build Mega Glest
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config Release --target ALL_BUILD

- name: Prepare Snapshot
run: |
cd mk/windoze
cp ..\shared\*.ini .
$7zPath = $(Get-Command 7z).Source
cp $7zPath .
cd ../..

- name: Create Mega Glest Snapshot
uses: actions/upload-artifact@v2
with:
Expand All @@ -154,7 +154,7 @@ jobs:
# - name: Get dependencies
# run: |
# brew install pkg-config cmake sdl2 lua jpeg libpng freetype ftgl libogg glew libvorbis cppunit fribidi miniupnpc curl wxmac xquartz zstd xml2 openldap

# - name: Bulid MegaGlest With Clang Compiler
# if: ${{ matrix.compiler == 'clang' }}
# env:
Expand All @@ -166,6 +166,6 @@ jobs:
# mk/macos/build-mg.sh
# - name: Test
# working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C ${{env.BUILD_TYPE}}
39 changes: 39 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Make Snapshot
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [ develop ]

# The artifact only runs on the same distro that it was built on.
# TODO: make AppImage instead
jobs:
make-snapshot:
strategy:
fail-fast: false
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Get dependencies
run: |
sudo apt-get update && sudo apt-get upgrade
sudo mk/linux/setupBuildDeps.sh
- name: Build
run: |
mk/linux/build-mg.sh -m
make -C mk/linux/build -j$(nproc) VERBOSE=1
- name: Prepare Snapshot
run: |
cp mk/shared/*.ini mk/linux/
strip -g mk/linux/megaglest mk/linux/megaglest_editor mk/linux/megaglest_g3dviewer
- name: Create Mega Glest Snapshot
uses: actions/upload-artifact@v2
with:
name: megaglest-x64-ubuntu-20.04-gcc
path: |
mk/linux/megaglest
mk/linux/megaglest_editor
mk/linux/megaglest_g3dviewer
mk/linux/*.ini
!mk/linux/glest-dev.ini
25 changes: 19 additions & 6 deletions docs/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ the default keyboard values).

* Camera keyboard controls *

f => toggle free camera mode
y => toggle free camera mode
w => move camera up (free camera mode only)
s => move camera down (free camera mode only)
a => rotate camera left (free camera mode only)
Expand Down Expand Up @@ -185,21 +185,34 @@ n => show network status

* Hotkeys (game camera mode only) *

a => activate attack command for selection
s => issue stop command to selection
, => activate attack command for selection
; => issue stop command to selection
i => select next idle harvester
b => select next building
d => select next damaged unit
u => select next damaged unit
t => select next storage unit
r => rotate building before placement

Unit commands can be activated using the keyboard by pressing corresponding
keys in the grid layout:

+---+---+---+---+
| q | w | e | r |
+---+---+---+---+
| a | s | d | f |
+---+---+---+---+
| z | x | c | v |
+---+---+---+---+

The position of the command for the selected unit (or group) in the UI
button grid corresponds to the key in the same position in the grid above.

* Other Keys *

- + => adjust game speed (disabled in multiplayer)
p => pause game (disabled in multiplayer)
e => save screen shot to file
c => toggle ingame font color (and font shadow)
j => save screen shot to file
o => toggle ingame font color (and font shadow)
m => show faded mesages again
? => when DebugMode=true, display debug info
/ => toggle mouse pointer rendering mode (OS/MG)
Expand Down
2 changes: 2 additions & 0 deletions mk/linux/glest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ AutoMaxFullScreen=false
AutoTest=false
CheckGlCaps=true
ColorBits=32
ComandsBasic=attack,stop,move,hold_position
ComandsCore=attack,produce,harvest,repair,build,upgrade,hold_position,move,stop
ConsoleMaxLines=8
ConsoleMaxLinesStored=25
ConsoleTimeout=20
Expand Down
14 changes: 5 additions & 9 deletions mk/linux/setupBuildDeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,9 @@ case $distribution in
#name > zesty, EoL January 2018
installcommand="apt-get install $APT_OPTIONS build-essential cmake libcurl4-gnutls-dev libsdl2-dev libopenal-dev liblua5.3-dev libjpeg-dev libpng-dev libfreetype6-dev libwxgtk3.0-dev libcppunit-dev libfribidi-dev libftgl-dev libglew-dev libogg-dev libvorbis-dev libminiupnpc-dev libircclient-dev libvlc-dev libvlccore-dev libxml2-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev librtmp-dev libkrb5-dev libldap2-dev libidn11-dev libgnutls28-dev libnghttp2-dev libssh2-1-dev libidn2-dev libpsl-dev"
;;
18.04)
#name > bionic
installcommand="apt-get install $APT_OPTIONS build-essential cmake libcurl4-gnutls-dev libsdl2-dev libopenal-dev liblua5.3-dev libjpeg-dev libpng-dev libfreetype6-dev libwxgtk3.0-dev libcppunit-dev libfribidi-dev libftgl-dev libglew-dev libogg-dev libvorbis-dev libminiupnpc-dev libircclient-dev libvlc-dev libvlccore-dev libxml2-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev librtmp-dev libkrb5-dev libldap2-dev libidn11-dev libgnutls28-dev libnghttp2-dev libssh2-1-dev libidn2-dev libpsl-dev"
;;
20.04)
#name > Focal Fossa
installcommand="apt-get install $APT_OPTIONS build-essential cmake libcurl4-gnutls-dev libsdl2-dev libopenal-dev liblua5.3-dev libjpeg-dev libpng-dev libfreetype6-dev libwxgtk3.0-gtk3-dev libcppunit-dev libfribidi-dev libftgl-dev libglew-dev libogg-dev libvorbis-dev libminiupnpc-dev libircclient-dev libvlc-dev libvlccore-dev libxml2-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev librtmp-dev libkrb5-dev libldap2-dev libidn2-dev libpsl-dev libgnutls28-dev libnghttp2-dev libssh-dev libbrotli-dev"
"18.04"|"20.04"|"22.04")
#name > Bionic, Focal Fossa, Jammy Jellyfish
installcommand="apt-get install $APT_OPTIONS build-essential cmake libcurl4-gnutls-dev libsdl2-dev libopenal-dev liblua5.3-dev libjpeg-dev libpng-dev libfreetype6-dev libwxgtk3.0-gtk3-dev libcppunit-dev libfribidi-dev libftgl-dev libglew-dev libogg-dev libvorbis-dev libminiupnpc-dev libircclient-dev libxml2-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev librtmp-dev libkrb5-dev libldap2-dev libidn2-dev libpsl-dev libgnutls28-dev libnghttp2-dev libssh-dev libbrotli-dev"
;;
*)
installcommand="apt-get install $APT_OPTIONS $packages_for_next_debian_ubuntu_mint"
Expand All @@ -177,15 +173,15 @@ case $distribution in
case $release in
20.04)
#name > Focal Fossa
installcommand="apt-get install $APT_OPTIONS build-essential cmake libcurl4-gnutls-dev libsdl2-dev libopenal-dev liblua5.3-dev libjpeg-dev libpng-dev libfreetype6-dev libwxgtk3.0-gtk3-dev libcppunit-dev libfribidi-dev libftgl-dev libglew-dev libogg-dev libvorbis-dev libminiupnpc-dev libircclient-dev libvlc-dev libvlccore-dev libxml2-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev librtmp-dev libkrb5-dev libldap2-dev libidn2-dev libpsl-dev libgnutls28-dev libnghttp2-dev libssh-dev libbrotli-dev"
installcommand="apt-get install $APT_OPTIONS build-essential cmake libcurl4-gnutls-dev libsdl2-dev libopenal-dev liblua5.3-dev libjpeg-dev libpng-dev libfreetype6-dev libwxgtk3.0-gtk3-dev libcppunit-dev libfribidi-dev libftgl-dev libglew-dev libogg-dev libvorbis-dev libminiupnpc-dev libircclient-dev libxml2-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev librtmp-dev libkrb5-dev libldap2-dev libidn2-dev libpsl-dev libgnutls28-dev libnghttp2-dev libssh-dev libbrotli-dev"
;;
*)
installcommand="apt-get install $APT_OPTIONS $packages_for_next_debian_ubuntu_mint"
unsupported_currently_this_OS="release"
;;
esac
;;

LinuxMint|Linuxmint)
case $release in
2)
Expand Down
2 changes: 2 additions & 0 deletions mk/macos/glest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ AutoMaxFullScreen=false
AutoTest=false
CheckGlCaps=true
ColorBits=32
ComandsBasic=attack,stop,move,hold_position
ComandsCore=attack,produce,harvest,repair,build,upgrade,hold_position,move,stop
ConsoleMaxLines=8
ConsoleMaxLinesStored=25
ConsoleTimeout=20
Expand Down
24 changes: 18 additions & 6 deletions mk/shared/glestkeys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
RenderInGamePerformance=`
RenderNetworkStatus=N
ShowFullConsole=M
Screenshot=E
FreeCameraMode=F
Screenshot=J
FreeCameraMode=Y
ResetCameraMode=space
CameraModeLeft=left
CameraModeRight=right
CameraModeUp=up
CameraModeDown=down
PauseGame=P
ChangeFontColor=C
ChangeFontColor=O
GameSpeedIncrease='+'
GameSpeedDecrease='-'
ExitKey=escape
Expand All @@ -30,16 +30,28 @@ CameraRotateLeft=A
CameraRotateRight=D
CameraRotateUp=S
CameraRotateDown=W
CommandKey1=Q
CommandKey2=W
CommandKey3=E
CommandKey4=R
CommandKey5=A
CommandKey6=S
CommandKey7=D
CommandKey8=F
CommandKey9=Z
CommandKey10=X
CommandKey11=C
CommandKey12=V
HotKeyCenterCameraOnSelection=G
HotKeySelectIdleHarvesterUnit=I
HotKeySelectBuiltBuilding=B
HotKeyShowDebug=?
HotKeyDumpWorldToLog=\
HotKeyRotateUnitDuringPlacement=R
HotKeySelectDamagedUnit=D
HotKeySelectDamagedUnit=U
HotKeySelectStoreUnit=T
HotKeySelectedUnitsAttack=A
HotKeySelectedUnitsStop=S
HotKeySelectedUnitsAttack=,
HotKeySelectedUnitsStop=;
HotKeyToggleOSMouseEnabled=/
ChatTeamMode=H
ToggleHealthbars=#
Expand Down
2 changes: 2 additions & 0 deletions mk/windoze/glest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ AutoMaxFullScreen=false
AutoTest=false
CheckGlCaps=true
ColorBits=32
ComandsBasic=attack,stop,move,hold_position
ComandsCore=attack,produce,harvest,repair,build,upgrade,hold_position,move,stop
ConsoleMaxLines=7
ConsoleMaxLinesStored=20
ConsoleTimeout=20
Expand Down
Loading