- alt-buttons support. button positions >9 are attached to

positions as 10=1, 11=2, ... and are show if alt key is pressed. this
  gives twice as many available buttons, still every button can have own
  hotkey.
This commit is contained in:
cade 2002-05-24 21:40:28 +00:00
parent e05045e06c
commit 1a2204732c
4 changed files with 36 additions and 19 deletions

View file

@ -11,7 +11,7 @@
# Compile commands
CC=gcc
CCLD=g++
CCLD=gcc
RM=rm -f
MAKE=make
@ -27,11 +27,13 @@ SDL = -DUSE_SDL -DUSE_SDLA $(SDL_CFLAGS)
SDL_CFLAGS = $(shell sdl-config --cflags)
SDLLIB = $(shell sdl-config --libs)
VIDEO = $(SDL)
VIDEO = $(SDL)
VIDEOLIB = $(SDLLIB) -ldl
# Sound support
DSOUND = -DWITH_SOUND
SDLCD = -DUSE_SDLCD
# Compression support
ZDEFS = -DUSE_ZLIB -DUSE_BZ2LIB
@ -43,12 +45,13 @@ XIFLAGS = -I/usr/X11R6/include -I/usr/local/include
#####################################################################
# Don't change anything below here unless you know what you're doing!
VERSION= '-DVERSION="1.17pre1-build16"'
VERSION= '-DVERSION="1.17-build19"'
PROFILE=
TOOLLIBS=$(XLDFLAGS) -lpng -lz -lm $(THREADLIB)
CLONELIBS=$(XLDFLAGS) -lpng -lz -lm \
$(THREADLIB) $(CCLLIB) $(VIDEOLIB) $(ZLIBS)
CLONELIBS= $(XLDFLAGS) -lpng -lz -lm \
$(THREADLIB) $(CCLLIB) $(VIDEOLIB) $(ZLIBS) \
$(FLACLIB) $(OGGLIB) $(MP3LIB) -lz -lm
DISTLIST=$(TOPDIR)/distlist
TAGS=$(TOPDIR)/src/tags
@ -63,8 +66,9 @@ OBJDIR=obj
IFLAGS= -I$(TOPDIR)/src/include $(XIFLAGS)
DFLAGS= $(THREAD) $(CCL) $(VERSION) \
$(VIDEO) $(ZDEFS) $(DSOUND) \
$(DEBUG) -DHAVE_EXPANSION
CFLAGS=-O2 -pipe -fomit-frame-pointer -fconserve-space -fexpensive-optimizations -ffast-math $(IFLAGS) $(DFLAGS) -DUNIT_ON_MAP -DNEW_AI -DUSE_LIBMODPLUG -DUSE_HP_FOR_XP
$(DEBUG) $(SDLCD) $(LIBCDA) \
$(FLAC) $(OGG) $(MAD)
CFLAGS=-O2 -pipe -fsigned-char -fomit-frame-pointer -fconserve-space -fexpensive-optimizations -ffast-math $(IFLAGS) $(DFLAGS) -DUNIT_ON_MAP -DNEW_AI -DUSE_LIBMODPLUG -DUSE_HP_FOR_XP -DNEW_NETMENUS -DSPLIT_SCREEN_SUPPORT
CTAGSFLAGS=-i defptvS -a -f
# Locks versions with a symbolic name

20
setup
View file

@ -441,7 +441,7 @@ if test "$WIN32" = 0 ; then
fi
echo
echo -n "Please enter selection: "
read -n 1 VIDSEL
read VIDSEL
echo
fi
@ -549,7 +549,7 @@ fi
echo
echo -n "Do you want to compile with sound? (y) "
read -n 1 ANSWER
read ANSWER
echo
case $ANSWER in
[nN])
@ -570,7 +570,7 @@ case $ANSWER in
echo
echo "Assuming you have a thread-safe X11 (libc6 or glibc),"
echo -n "do you want to compile with threaded sound? (n) "
read -n 1 ANSWER2
read ANSWER2
echo
case $ANSWER2 in [yY])
echo "THREAD = -D_REENTRANT -DUSE_THREAD" >> $RULESFILE
@ -587,7 +587,7 @@ case $ANSWER in
LIBCHECK="-lFLAC -lm"; check_for_libs
if test "$?" = 0 ; then
echo -n "Would you like FLAC support? (n) "
read -n 1 ANSWER
read ANSWER
echo
case $ANSWER in
[yY])
@ -605,7 +605,7 @@ case $ANSWER in
LIBCHECK="-lvorbisfile -lvorbis -logg"; check_for_libs
if test "$?" = 0 ; then
echo -n "Would you like OGG support? (n) "
read -n 1 ANSWER
read ANSWER
echo
case $ANSWER in
[yY])
@ -635,7 +635,7 @@ case $ANSWER in
LIBCHECK="-lmad"; check_for_libs
if test "$?" = 0 ; then
echo -n "Would you like MAD MP3 support? (n) "
read -n 1 ANSWER
read ANSWER
echo
case $ANSWER in
[yY])
@ -655,7 +655,7 @@ case $ANSWER in
echo -n "or [S]DL "
fi
echo -n "CD Audio support? (n) "
read -n 1 CDMode
read CDMode
echo
case $CDMode in
[sS])
@ -739,7 +739,7 @@ if (test "$HAVE_LIBZ" = 1 -o "$HAVE_LIBZ" = 2 && test "$HAVE_LIBBZ2" = 1 && test
fi
echo
echo -n "Please enter selection ($COMPDEF): "
read -n 1 COMPOPT
read COMPOPT
echo
if test "$COMPOPT x" = " x" ; then COMPOPT=$COMPDEF; fi
@ -897,7 +897,7 @@ echo -n " \$(FLAC) \$(OGG) \$(MAD) " >> $RULESFILE
echo
echo -n "Are you using the WarCraft 2 Expansion CD? (n): "
read -n 1 YESORNO
read YESORNO
echo
if [ "$YESORNO" = "Y" -o "$YESORNO" = "y" ] ; then
echo -n " -DHAVE_EXPANSION" >> $RULESFILE
@ -965,7 +965,7 @@ echo
echo "Done generating $RULESFILE."
echo
echo -n "Would you like to compile it now? (y) "
read -n 1 ANSWER
read ANSWER
echo
case $ANSWER in

View file

@ -686,16 +686,27 @@ global void UpdateButtonPanel(void)
}
for( z = 0; z < NumUnitButtons; z++ ) {
int pos; //keep position, midified if alt-buttons required
//FIXME: we have to check and if these unit buttons are available
// i.e. if button action is ButtonTrain for example check if
// required unit is not restricted etc...
buttonaction=UnitButtonTable[z];
pos = buttonaction->Pos;
// Same level
if ( buttonaction->Level != CurrentButtonLevel ) {
continue;
}
if ( pos > 9 ) // VLADI: this allows alt-buttons
{
if ( KeyModifiers & ModifierAlt )
pos -= 9; // buttons with pos >9 are shown on if ALT is pressed
else
continue;
}
// any unit or unit in list
if ( buttonaction->UnitMask[0] != '*'
&& !strstr( buttonaction->UnitMask, unit_ident ) ) {
@ -780,7 +791,7 @@ global void UpdateButtonPanel(void)
}
if (allow) { // is button allowed after all?
_current_buttons[buttonaction->Pos-1] = (*buttonaction);
_current_buttons[pos-1] = (*buttonaction);
}
}

View file

@ -1001,6 +1001,7 @@ global int HandleKeyModifiersDown(unsigned key,
return 1;
case KeyCodeAlt:
KeyModifiers|=ModifierAlt;
UpdateButtonPanel(); //VLADI: to allow alt-buttons
return 1;
case KeyCodeSuper:
KeyModifiers|=ModifierSuper;
@ -1034,6 +1035,7 @@ global int HandleKeyModifiersUp(unsigned key,
return 1;
case KeyCodeAlt:
KeyModifiers&=~ModifierAlt;
UpdateButtonPanel(); //VLADI: to allow alt-buttons
return 1;
case KeyCodeSuper:
KeyModifiers&=~ModifierSuper;