summaryrefslogtreecommitdiff
path: root/src/screen
diff options
context:
space:
mode:
Diffstat (limited to 'src/screen')
-rw-r--r--src/screen/screen_credits.c1
-rw-r--r--src/screen/screen_setting.c50
-rw-r--r--src/screen/screen_setting.h4
-rw-r--r--src/screen/screen_world.c8
4 files changed, 19 insertions, 44 deletions
diff --git a/src/screen/screen_credits.c b/src/screen/screen_credits.c
index 39859cd..6de034a 100644
--- a/src/screen/screen_credits.c
+++ b/src/screen/screen_credits.c
@@ -27,6 +27,7 @@ static list_t *listWidgetLabel;
static textFile_t *textFile;
static int offset;
static int creditExists;
+
void startScreenCredits()
{
#ifndef NO_SOUND
diff --git a/src/screen/screen_setting.c b/src/screen/screen_setting.c
index e4936f2..d853265 100644
--- a/src/screen/screen_setting.c
+++ b/src/screen/screen_setting.c
@@ -207,22 +207,6 @@ static void eventWidget(void *p)
setSoundActive( check_sound->status );
}
#endif
- if( check == check_ai )
- {
- if ( check_ai->status )
- {
- // ai je zapnuto nechceme hrace 2
- destroyWidgetTextfield(textfield_name_player2);
- destroyWidgetLabel(label_name_player2);
- }
- else {
- // ai je vypnuto chceme hrace 2
- label_name_player2 = newWidgetLabel(getMyText("NAME_PLAYER2"), 100, WINDOW_SIZE_Y-120, WIDGET_LABEL_LEFT);
- drawWidgetLabel(label_name_player2);
- textfield_name_player2 = newWidgetTextfield(getParamElse("--name2", "TUX Warrior #02"), 110+label_name_player2->w, WINDOW_SIZE_Y-120);
- drawWidgetTextfield(textfield_name_player2);
- }
- }
}
static void initSettingFile()
@@ -309,17 +293,7 @@ static void saveAndDestroyConfigFile()
setValueInConfigFile(configFile, "COUNT_ROUND", textfield_count_cound->text );
setValueInConfigFile(configFile, "NAME_PLAYER_RIGHT", textfield_name_player1->text );
-
- if( check_ai->status )
- {
- loadValueFromConfigFile(configFile, "NAME_PLAYER_LEFT", val, STR_SIZE, "TUX Warrior #02");
- strcpy(name2, val);
- setValueInConfigFile(configFile, "NAME_PLAYER_LEFT", name2 );
- }
- else
- {
- setValueInConfigFile(configFile, "NAME_PLAYER_LEFT", textfield_name_player2->text );
- }
+ setValueInConfigFile(configFile, "NAME_PLAYER_LEFT", textfield_name_player2->text );
setValueInConfigFile(configFile, "GUN_DUAL_SIMPLE", getYesOrNo(check[GUN_DUAL_SIMPLE]->status) );
setValueInConfigFile(configFile, "GUN_SCATTER", getYesOrNo(check[GUN_SCATTER]->status) );
@@ -327,6 +301,7 @@ static void saveAndDestroyConfigFile()
setValueInConfigFile(configFile, "GUN_LASSER", getYesOrNo(check[GUN_LASSER]->status) );
setValueInConfigFile(configFile, "GUN_MINE", getYesOrNo(check[GUN_MINE]->status) );
setValueInConfigFile(configFile, "GUN_BOMBBALL", getYesOrNo(check[GUN_BOMBBALL]->status) );
+
setValueInConfigFile(configFile, "BONUS_SPEED", getYesOrNo(check[BONUS_SPEED]->status) );
setValueInConfigFile(configFile, "BONUS_SHOT", getYesOrNo(check[BONUS_SHOT]->status) );
setValueInConfigFile(configFile, "BONUS_TELEPORT", getYesOrNo(check[BONUS_TELEPORT]->status) );
@@ -376,9 +351,8 @@ void initScreenSetting()
textfield_count_cound = newWidgetTextfield(getParamElse("--count", "15"), 110+label_count_round->w, WINDOW_SIZE_Y-200);
- textfield_name_player1 = newWidgetTextfield(getParamElse("--name1", "TUX Warrior #01"), 110+label_name_player1->w, WINDOW_SIZE_Y-160);
- if ( check_ai->status == 0 )
- textfield_name_player2 = newWidgetTextfield(getParamElse("--name2", "TUX Warrior #02"), 110+label_name_player2->w, WINDOW_SIZE_Y-120);
+ textfield_name_player1 = newWidgetTextfield(getParamElse("--name1", NAME_PLAYER_RIGHT), 110+label_name_player1->w, WINDOW_SIZE_Y-160);
+ textfield_name_player2 = newWidgetTextfield(getParamElse("--name2", NAME_PLAYER_LEFT), 110+label_name_player2->w, WINDOW_SIZE_Y-120);
for( i = GUN_DUAL_SIMPLE ; i <= GUN_BOMBBALL ; i++ )
{
@@ -452,7 +426,14 @@ void getSettingNameRight(char *s)
void getSettingNameLeft(char *s)
{
- strcpy(s, textfield_name_player2->text);
+ if( check_ai->status )
+ {
+ strcpy(s, NAME_AI);
+ }
+ else
+ {
+ strcpy(s, textfield_name_player2->text);
+ }
}
void getSettingCountRound(int *n)
@@ -509,11 +490,8 @@ void quitScreenSetting()
destroyWidgetLabel(label_music);
destroyWidgetLabel(label_sound);
#endif
- if ( check_ai->status == 0 )
- {
- destroyWidgetLabel(label_name_player2);
- destroyWidgetTextfield(textfield_name_player2);
- }
+ destroyWidgetLabel(label_name_player2);
+ destroyWidgetTextfield(textfield_name_player2);
destroyWidgetTextfield(textfield_name_player1);
destroyWidgetTextfield(textfield_count_cound);
diff --git a/src/screen/screen_setting.h b/src/screen/screen_setting.h
index 744e768..d80a7a5 100644
--- a/src/screen/screen_setting.h
+++ b/src/screen/screen_setting.h
@@ -5,6 +5,10 @@
#include "main.h"
+#define NAME_AI "tuxAI"
+#define NAME_PLAYER_RIGHT "TUX Warrior #01"
+#define NAME_PLAYER_LEFT "TUX Warrior #02"
+
extern void initScreenSetting();
extern void drawScreenSetting();
extern void eventScreenSetting();
diff --git a/src/screen/screen_world.c b/src/screen/screen_world.c
index 16fffe8..f5556c9 100644
--- a/src/screen/screen_world.c
+++ b/src/screen/screen_world.c
@@ -43,7 +43,6 @@
static arena_t *arena;
static int count;
static int max_count;
-static my_time_t lastServerLag;
static bool_t isScreenWorldInit = FALSE;
static bool_t isEndWorld;
@@ -82,11 +81,6 @@ void setMaxCountRound(int n)
max_count = n;
}
-void setLagServer(my_time_t lag)
-{
- lastServerLag = lag;
-}
-
void setWorldEnd()
{
isEndWorld = TRUE;
@@ -373,7 +367,6 @@ static void eventEsc()
if( mapa[(SDLKey)SDLK_ESCAPE] == SDL_PRESSED && isChatActive() == FALSE )
{
- isEndWorld = TRUE;
setWorldEnd();
return;
}
@@ -493,7 +486,6 @@ void startWorld()
isEndWorld = FALSE;
count = 0;
- lastServerLag = LAG_SERVER_UNKNOWN;
initListID();
initRadar();