Open GreenLunar opened 8 years ago
Example in Bash
tput bold; echo -n 'connected: player01'; tput sgr0; echo
tput bold; echo -n 'Player '; tput sgr0; tput setaf 2; echo -n 'player01'; tput sgr0; tput bold; echo -n ' connected from '; tput sgr0; tput setaf 2; echo -n 'Germany'; tput sgr0; echo
tput bold; tput setaf 3; echo -n 'player05 has the CLA flag'; tput sgr0; echo
tput bold; tput setaf 3; echo -n 'player03 sprayed player04'; tput sgr0; echo
tput bold; tput setaf 3; echo -n 'player02 punctured player06'; tput sgr0; echo
tput bold; echo -n 'player01: '; tput setaf 2; echo -n 'Awesome!'; tput sgr0; echo
tput bold; tput setaf 1; echo -n 'Respect everybody'; tput sgr0; echo
Edit: Line 2 may also be:
tput bold; echo -n 'Player '; tput setaf 0; echo -n 'player01'; tput sgr0; tput bold; echo -n ' connected from '; tput setaf 0; echo -n 'Germany'; tput sgr0; echo
Edit: Alternative
tput bold
echo -n 'connected: player01'; tput setaf 9 ; echo
echo -n 'Player '; tput setaf 0; echo -n 'player01'; tput setaf 9; echo -n ' connected from '; tput setaf 0; echo -n 'Germany'; tput setaf 9; echo
tput setaf 3; echo -n 'player05 has the CLA flag'; tput setaf 9; echo
tput setaf 3; echo -n 'player03 sprayed player04'; tput setaf 9; echo
tput setaf 3; echo -n 'player02 punctured player06'; tput setaf 9; echo
echo -n 'player01: '; tput setaf 2; echo -n 'Awesome!'; tput setaf 9; echo
tput setaf 1; echo -n 'Respect everybody'; tput setaf 9; echo
tput sgr0
for i in {0..7} 9; do tput setaf $i; echo tput setaf $i; done
tput bold; for i in {0..7} 9; do tput setaf $i; echo tput setaf $i; done
When starting AssaultCube from a terminal emulator, the entire stdout output is in the same color.
Example output from Weed Lounge:
In terminal emulator, it would look as follows:
In AssaultCube, it would look as follows: