Updated mission config settings.

This commit is contained in:
Steve 2018-05-12 11:50:49 +01:00
parent 181fc83632
commit 05e7fc7cad
7 changed files with 123 additions and 23 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Blob Wars : Attrition\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-29 07:46:49+0100\n"
"POT-Creation-Date: 2018-05-12 11:50:05+0100\n"
"PO-Revision-Date: ???\n"
"Last-Translator: ???\n"
"Language-Team: ???\n"
@ -265,12 +265,18 @@ msgstr ""
msgid "Cells: %d / %d"
msgstr ""
msgid "Mission configuration"
msgstr ""
msgid "! Corrupt data"
msgstr ""
msgid "- empty -"
msgstr ""
msgid "Defeat enemies"
msgstr ""
msgid "This is an information point. Bob can stand by them for a few moments to see what they have to say. There are many scattered throughout this tutorial map, to help you learn how to play. They will also appear from time to time during the actual game. Stand by them for a short time, to get more information. If you get lost, tap the radar icon in the top left, to view a map of the local area."
msgstr ""
@ -433,9 +439,6 @@ msgstr ""
msgid "Find Teeka"
msgstr ""
msgid "Defeat enemies"
msgstr ""
msgid "Destroy Toxic Barrels"
msgstr ""

View File

@ -431,11 +431,12 @@ enum
ST_HUB_CELLS,
ST_CORRUPT_SAVE,
ST_EMPTY_SAVE,
ST_MISSION_CONFIG,
ST_MAX
};
#define PLUS_NONE 0
#define PLUS_BASIC (2 << 0)
#define PLUS_ALL_OBJS (2 << 0)
#define PLUS_STRONGER (2 << 1)
#define PLUS_RANDOM (2 << 2)
#define PLUS_KILL_ALL (2 << 3)

View File

@ -343,7 +343,8 @@ void loadGame(int slot)
}
else
{
printf("Corrupt save file\n");
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, "Corrupt save file: %s", filename);
exit(1);
}
free(text);

View File

@ -143,7 +143,7 @@ static void draw(void)
SDL_SetTextureAlphaMod(atlasTexture->texture, 255);
drawText(10, SCREEN_HEIGHT - 30, 16, TA_LEFT, colors.white, "Copyright 2014, 2018 Parallel Realities");
drawText(SCREEN_WIDTH - 10, SCREEN_HEIGHT - 30, 16, TA_RIGHT, colors.white, "Version %.2f.%d", VERSION, REVISION);
drawText(SCREEN_WIDTH - 10, SCREEN_HEIGHT - 30, 16, TA_RIGHT, colors.white, "Version %.1f.%d", VERSION, REVISION);
drawWidgets();

View File

@ -28,6 +28,7 @@ static HubMission *getMissionAt(int x, int y);
static void drawMissions(void);
static void drawInfoBar(void);
static void drawMissionInfo(void);
static void drawPlusSettings(void);
static void logic(void);
static void draw(void);
static void startMission(void);
@ -44,6 +45,7 @@ static void drawHudWidgets(void);
static void awardMissionTrophies(void);
static void returnFromOptions(void);
void destroyHub(void);
static void startMissionPlus(void);
static HubMission hubMissionHead;
static HubMission *hubMissionTail;
@ -59,6 +61,7 @@ static PointF cursor;
static float blipSize;
static float blipValue;
static int showing;
static int doPlusSettings;
static PointF cloudPos;
void initHub(void)
@ -105,6 +108,9 @@ void initHub(void)
getWidget("ok", "stats")->action = returnFromTrophyStats;
getWidget("ok", "trophies")->action = returnFromTrophyStats;
getWidget("startMission", "missionPlus")->action = startMissionPlus;
getWidget("cancel", "missionPlus")->action = cancel;
loadMissions();
if (dev.cheatLevels)
@ -122,13 +128,15 @@ void initHub(void)
blipValue = 0;
doPlusSettings = 0;
showing = SHOW_NONE;
cursor.x = SCREEN_WIDTH / 2;
cursor.y = SCREEN_HEIGHT / 2;
SDL_WarpMouseInWindow(app.window, cursor.x * app.scaleX, cursor.y * app.scaleY);
game.isComplete = 0;
game.isComplete = 1;
for (t = game.missionStatusHead.next ; t != NULL ; t = t->next)
{
@ -344,8 +352,17 @@ static void doMissionInfo(void)
w = selectWidgetAt(cursor.x, cursor.y);
if ((w != NULL) && (isControl(CONTROL_FIRE) || app.mouse.button[SDL_BUTTON_LEFT]))
{
if (w->type == WT_BUTTON)
{
w->action();
}
else if (w->type == WT_SPINNER)
{
/* assuming there are only two options */
w->value[0] = !w->value[0];
}
app.mouse.button[SDL_BUTTON_LEFT] = 0;
clearControl(CONTROL_FIRE);
}
@ -370,8 +387,16 @@ static void draw(void)
{
case SHOW_NONE:
if (selectedMission != NULL)
{
if (!doPlusSettings)
{
drawMissionInfo();
}
else
{
drawPlusSettings();
}
drawWidgets();
}
blitRect(atlasTexture->texture, cursor.x, cursor.y, getCurrentFrame(cursorSpr), 1);
@ -494,6 +519,24 @@ static void drawMissionInfo(void)
}
}
static void drawPlusSettings(void)
{
int w, h, x, y;
w = 800;
h = 550;
x = (SCREEN_WIDTH - w) / 2;
y = (SCREEN_HEIGHT - h) / 2;
drawRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0, 128);
drawRect(x, y, w, h, 0, 0, 0, 192);
drawOutlineRect(x, y, w, h, 255, 255, 255, 255);
drawText(SCREEN_WIDTH / 2, y + 25, 32, TA_CENTER, colors.white, selectedMission->name);
drawText(SCREEN_WIDTH / 2, y + 75, 24, TA_CENTER, colors.white, app.strings[ST_MISSION_CONFIG]);
}
static void unlockMission(char *id)
{
Tuple *t;
@ -593,6 +636,8 @@ HubMission *getMissionAt(int x, int y)
}
static void startMission(void)
{
if (!game.isComplete)
{
STRNCPY(game.worldId, selectedMission->id, MAX_NAME_LENGTH);
@ -604,6 +649,15 @@ static void startMission(void)
initWorld();
}
else
{
hideAllWidgets();
showWidgetGroup("missionPlus");
doPlusSettings = 1;
}
}
static void cancel(void)
{
@ -613,6 +667,46 @@ static void cancel(void)
app.keyboard[SDL_SCANCODE_ESCAPE] = 0;
}
static void startMissionPlus(void)
{
game.plus = 0;
if (getWidget("allObjectives", "missionPlus")->value[0])
{
game.plus |= PLUS_ALL_OBJS;
}
if (getWidget("randomEnemies", "missionPlus")->value[0])
{
game.plus |= PLUS_RANDOM;
}
if (getWidget("tougherEnemies", "missionPlus")->value[0])
{
game.plus |= PLUS_STRONGER;
}
if (getWidget("defeatAllEnemies", "missionPlus")->value[0])
{
game.plus |= PLUS_KILL_ALL;
}
if (getWidget("mirrorWorld", "missionPlus")->value[0])
{
game.plus |= PLUS_MIRROR;
}
STRNCPY(game.worldId, selectedMission->id, MAX_NAME_LENGTH);
saveGame(0);
stopMusic();
destroyHub();
initWorld();
}
static void options(void)
{
initOptions(returnFromOptions);

View File

@ -30,8 +30,8 @@ static HashTable table;
void setLanguage(char *applicationName, char *languageCode)
{
char language[MAX_LINE_LENGTH];
char **key, **value, *c;
char language[MAX_DESCRIPTION_LENGTH], c[MAX_LINE_LENGTH];
char **key, **value;
#ifndef _WIN32
char *lang;
#endif
@ -54,7 +54,7 @@ void setLanguage(char *applicationName, char *languageCode)
if (c[0] != '\0')
{
STRNCPY(language, c, MAX_LINE_LENGTH);
STRNCPY(language, c, MAX_DESCRIPTION_LENGTH);
GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, c, MAX_LINE_LENGTH);
@ -68,14 +68,14 @@ void setLanguage(char *applicationName, char *languageCode)
#else
if ((lang = getenv("LC_ALL")) || (lang = getenv("LC_CTYPE")) || (lang = getenv("LANG")))
{
STRNCPY(language, lang, MAX_LINE_LENGTH);
STRNCPY(language, lang, MAX_DESCRIPTION_LENGTH);
}
#endif
}
else
{
STRNCPY(language, languageCode, MAX_LINE_LENGTH);
STRNCPY(language, languageCode, MAX_DESCRIPTION_LENGTH);
}
strtok(language, ".");

View File

@ -93,6 +93,7 @@ void initStrings(void)
app.strings[ST_HUB_KEYS] = _("Keys: %d / %d");
app.strings[ST_HUB_HEARTS] = _("Hearts: %d / %d");
app.strings[ST_HUB_CELLS] = _("Cells: %d / %d");
app.strings[ST_MISSION_CONFIG] = _("Mission configuration");
app.strings[ST_CORRUPT_SAVE] = _("! Corrupt data");
app.strings[ST_EMPTY_SAVE] = _("- empty -");