Merge branch 'master' into dev
Conflicts: scripts/ai/empire.lua scripts/ai/pirate.lua src/comm.c
2
TODO
@ -1,10 +1,10 @@
|
||||
Vital:
|
||||
-- Pilot Communication system.
|
||||
-- Request fuel.
|
||||
-- Introductory screen (text + image?).
|
||||
-- System obstacles and such.
|
||||
-- Interference
|
||||
-- Asteroids.
|
||||
-- More loading screens.
|
||||
-- Real news.
|
||||
-- Dynamic Economy.
|
||||
|
||||
|
@ -74,6 +74,7 @@ DATA_AI := $(wildcard ../scripts/ai/*.lua \
|
||||
../scripts/ai/include/*.lua \
|
||||
../scripts/ai/tpl/*.lua)
|
||||
DATA_GFX := $(wildcard ../gfx/*.png \
|
||||
../gfx/loading/*.png \
|
||||
../gfx/gui/*.png \
|
||||
../gfx/logo/*.png \
|
||||
../gfx/outfit/space/*.png \
|
||||
|
BIN
gfx/loading/admonisher.png
Normal file
After Width: | Height: | Size: 318 KiB |
BIN
gfx/loading/gawain.png
Normal file
After Width: | Height: | Size: 298 KiB |
BIN
gfx/loading/goddard.png
Normal file
After Width: | Height: | Size: 390 KiB |
BIN
gfx/loading/llama.png
Normal file
After Width: | Height: | Size: 370 KiB |
BIN
gfx/loading/mule.png
Normal file
After Width: | Height: | Size: 375 KiB |
Before Width: | Height: | Size: 423 KiB After Width: | Height: | Size: 423 KiB |
@ -121,6 +121,7 @@ static void comm_bribe(unsigned int wid, char* unused) {
|
||||
int answer;
|
||||
int price;
|
||||
char* str;
|
||||
lua_State* L;
|
||||
|
||||
/* Set up for the comm_get* functions. */
|
||||
ai_setPilot(comm_pilot);
|
||||
@ -162,7 +163,15 @@ static void comm_bribe(unsigned int wid, char* unused) {
|
||||
dialogue_msg("Bribe Pilot", "\"Pleasure to do business with you.\"");
|
||||
else
|
||||
dialogue_msg("Bribe Pilot", "%s", str);
|
||||
|
||||
/* Mark as bribed and don't allow bribing again. */
|
||||
pilot_setFlag(comm_pilot, PILOT_BRIBED);
|
||||
L = comm_pilot->ai->L;
|
||||
lua_getglobal(L, "mem");
|
||||
lua_pushnil(L);
|
||||
lua_setfield(L, -2, "bribe");
|
||||
lua_pop(L, 1);
|
||||
|
||||
/* Reopen window. */
|
||||
window_destroy(wid);
|
||||
comm_open(comm_pilot->id);
|
||||
|
@ -279,6 +279,7 @@ int main(int argc, char** argv) {
|
||||
void loadscreen_load(void) {
|
||||
int i;
|
||||
char file_path[PATH_MAX];
|
||||
char** loadscreens;
|
||||
char** files;
|
||||
uint32_t nfiles;
|
||||
size_t len;
|
||||
@ -286,12 +287,15 @@ void loadscreen_load(void) {
|
||||
|
||||
/* Count the loading screens. */
|
||||
files = pack_listfiles(data, &nfiles);
|
||||
len = strlen("../gfx/loading");
|
||||
len = strlen("../gfx/loading/");
|
||||
nload = 0;
|
||||
loadscreens = malloc(sizeof(char*) * nfiles);
|
||||
for(i = 0; i < (int)nfiles; i++) {
|
||||
if(strncmp(files[i], "../gfx/loading", len)==0)
|
||||
if(strncmp(files[i], "../gfx/loading/", len)==0) {
|
||||
loadscreens[nload] = files[i];
|
||||
nload++;
|
||||
free(files[i]);
|
||||
} else
|
||||
free(files[i]);
|
||||
}
|
||||
|
||||
/* Must have loading screens. */
|
||||
@ -301,8 +305,13 @@ void loadscreen_load(void) {
|
||||
}
|
||||
|
||||
/* Load the texture. */
|
||||
snprintf(file_path, PATH_MAX, "../gfx/loading%03d.png", RNG(0, nload-1));
|
||||
snprintf(file_path, PATH_MAX, loadscreens[RNG(0, nload-1)]);
|
||||
loading = gl_newImage(file_path);
|
||||
|
||||
/* Clean up. */
|
||||
for(i = 0; i < nload; i++)
|
||||
free(loadscreens[i]);
|
||||
free(loadscreens);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,4 @@
|
||||
#ifdef _POSIX_SOURCE
|
||||
#include <unistd.h> /* Unlink. */
|
||||
#endif
|
||||
|
||||
#include <stdio.h> /* remove() */
|
||||
#include "lephisto.h"
|
||||
#include "log.h"
|
||||
#include "xml.h"
|
||||
@ -191,7 +188,7 @@ static void load_menu_delete(unsigned int wdw, char* str) {
|
||||
return;
|
||||
|
||||
snprintf(path, PATH_MAX, "%ssaves/%s.ls", lfile_basePath(), save);
|
||||
unlink(path);
|
||||
remove(path); /* Remove is more portable and will call unlink on Linux. */
|
||||
|
||||
/* Need to reload the menu. */
|
||||
load_menu_close(wdw, NULL);
|
||||
|