Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • STJr/SRB2
  • Sryder/SRB2
  • wolfy852/SRB2
  • Alpha2244/SRB2
  • Inuyasha/SRB2
  • yoshibot/SRB2
  • TehRealSalt/SRB2
  • PrisimaTF/SRB2
  • Hatninja/SRB2
  • SteelT/SRB2
  • james/SRB2
  • ShaderWraith/SRB2
  • SinnamonLat/SRB2
  • mazmazz_/SRB2
  • filpAM/SRB2
  • chaoloveicemdboy/SRB2
  • Whooa21/SRB2
  • Machturne/SRB2
  • Golden/SRB2
  • Tatsuru/SRB2
  • Snu/SRB2
  • Zwip-Zwap_Zapony/SRB2
  • fickleheart/SRB2
  • alphaRexJames/SRB2
  • JJK/SRB2
  • diskpoppy/SRB2
  • Hannu_Hanhi/SRB2
  • ZipperQR/SRB2
  • kays/SRB2
  • spherallic/SRB2
  • Zippy_Zolton/SRB2
  • namiishere/SRB2
  • Ors/SRB2
  • SMS_Alfredo/SRB2
  • sonic_edge/SRB2
  • lavla/SRB2
  • ashi/SRB2
  • X.organic/SRB2
  • Fafabis/SRB2
  • Meziu/SRB2
  • v-rob/SRB2
  • tertu/SRB2
  • bitten2up/SRB2
  • flarn2006/SRB2
  • Krabs/SRB2
  • clairebun/SRB2
  • Lactozilla/SRB2
  • thehackstack/SRB2
  • Spice/SRB2
  • win8linux/SRB2
  • JohnFrostFox/SRB2
  • talktoneon726/SRB2
  • Wane/SRB2
  • Lamibe/SRB2
  • spectrumuk2/srb-2
  • nerdyminer18/srb-2
  • 256nil/SRB2
  • ARJr/SRB2
  • Alam/SRB2
  • Zenya/srb-2-marathon-demos
  • Acelite/srb-2-archivedmodifications
  • MIDIMan/SRB2
  • Lach/SRB2
  • Frostiikin/bounce-tweaks
  • Hanicef/SRB2Classic
  • Jaden/SRB2
  • Tyron/SRB2
  • Astronight/SRB2
  • Mari0shi06/SRB2
  • aiire/SRB2
  • Galactice/SRB2
  • srb2-ports/srb2-dreamcast
  • sdasdas/SRB2
  • chreas/srb-2-vr
  • StarManiaKG/the-story-of-sinically-rocketing-and-botching-the-2nd
  • LoganAir/SRB2
  • NepDisk/srb-2
  • alufolie91/SRB2
  • Felicia.iso/SRB2
  • twi/SRB2
  • BarrelsOFun/SRB2
  • Speed2411/SRB2
  • Leather_Realms/SRB2
  • Ayemar/SRB2
  • Acelite/SRB2
  • VladDoc/SRB2
  • kaldrum/model-features
  • strawberryfox417/SRB2
  • Lugent/SRB2
  • Jisk/SRB2
  • Rem/SRB2
  • Refrag/SRB2
  • Henry_3230/srb-3230
  • TehPuertoRicanSpartan2/tprs-srb2
  • Leminn/srb-2-marathon-stuff
  • chromaticpipe2/SRB2
  • MiguelGustavo15/SRB2
  • Maru/srb-2-tests
  • SilicDev/SRB2
  • UnmatchedBracket/SRB2
  • HybridDog/SRB2
  • xordspar0/SRB2
  • jsjhbewfhh/SRB2
  • Fancy2209/SRB2
  • Lorsoen/SRB2
  • shindoukin/SRB2
  • GamerOfDays/SRB2
  • Craftyawesome/SRB2
  • tenshi-tensai-tennoji/SRB2
  • Scarfdudebalder/SRB2
  • luigi-budd/srb-2-fix-interplag-lockon
  • mskluesner/SRB2
  • johnpetersa19/SRB2
  • Pheazant/SRB2
  • chromaticpipe2/srb2classic
  • romoney5/SRB2
  • PAS/SRB2Classic
  • BlueStaggo/SRB2
118 results
Show changes
Commits on Source (11)
......@@ -3490,6 +3490,18 @@ static void readcondition(UINT8 set, UINT32 id, char *word2)
return;
}
}
else if (fastcmp(params[0], "LUA"))
{
PARAMCHECK(1);
ty = UC_LUA;
re = atoi(params[1]);
if (re <= 0 || re > MAXLUACONDITIONS)
{
deh_warning("Lua condition %d out of range (1 - %d)", re, MAXLUACONDITIONS);
return;
}
}
else if (fastcmp(params[0], "CONDITIONSET"))
{
PARAMCHECK(1);
......
......@@ -3881,6 +3881,34 @@ static int lib_gAddGametype(lua_State *L)
return 0;
}
// Lua exclusive function to unlock Lua Conditions
// Up to Lua scripter
static int lib_gUnlockCondition(lua_State* L)
{
int id = luaL_checkinteger(L, 1) - 1;
boolean global = luaL_checkboolean(L, 2);
if (id <= 0 || id > MAXLUACONDITIONS)
{
luaL_error(L, "Lua condition %d out of range (1 - %d)", id + 1, MAXLUACONDITIONS);
return 0;
}
if (global)
{
serverGamedata->lua[id] = true;
M_SilentUpdateUnlockablesAndEmblems(serverGamedata);
}
clientGamedata->lua[id] = true;
if (M_UpdateUnlockablesAndExtraEmblems(clientGamedata))
{
S_StartSound(NULL, sfx_s3k68);
}
return 0;
}
// Bot adding function!
// Partly lifted from Got_AddPlayer
static int lib_gAddPlayer(lua_State *L)
......@@ -4629,6 +4657,7 @@ static luaL_Reg lib[] = {
{"G_AddGametype", lib_gAddGametype},
{"G_AddPlayer", lib_gAddPlayer},
{"G_RemovePlayer", lib_gRemovePlayer},
{"G_UnlockCondition", lib_gUnlockCondition},
{"G_SetUsedCheats", lib_gSetUsedCheats},
{"G_BuildMapName",lib_gBuildMapName},
{"G_BuildMapTitle",lib_gBuildMapTitle},
......
......@@ -87,6 +87,7 @@ automatically.
X (scores),/* emblems/multiplayer list */\
X (title),/* titlescreen */\
X (titlecard),\
X (escpanel) /* rings/time/score/emblem panel in pause menu */,\
X (intermission),\
X (continue),\
X (playersetup),\
......@@ -128,6 +129,10 @@ int LUA_HookCharacterHUD
INT32 skinIndex, UINT8 sprite2, UINT8 frame, UINT8 rotation, skincolornum_t color,
INT32 ticker, boolean mode
);
boolean LUA_HookEscapePanel(
int hook, huddrawlist_h drawlist,
int x, int y, int width, int height
);
int LUA_HookMobj(mobj_t *, int hook);
int LUA_Hook2Mobj(mobj_t *, mobj_t *, int hook);
......
......@@ -738,6 +738,22 @@ int LUA_HookCharacterHUD
return hook.status;
}
boolean LUA_HookEscapePanel(int hook, huddrawlist_h drawlist, int x, int y, int width, int height)
{
Hook_State hookstate;
if (prepare_hud_hook(&hookstate, false, hook))
{
LUA_SetHudHook(hook, drawlist);
lua_pushinteger(gL, x);
lua_pushinteger(gL, y);
lua_pushinteger(gL, width);
lua_pushinteger(gL, height);
call_hud_hooks(&hookstate, 1, res_true);
}
return hookstate.status;
}
/* =========================================================================
SPECIALIZED HOOKS
========================================================================= */
......
......@@ -412,6 +412,15 @@ int LUA_PushGlobals(lua_State *L, const char *word)
} else if (fastcmp(word, "token")) {
lua_pushinteger(L, token);
return 1;
} else if (fastcmp(word, "emblems")) {
lua_pushinteger(L, M_CountEmblems(clientGamedata));
return 1;
} else if (fastcmp(word, "numemblems")) {
lua_pushinteger(L, numemblems);
return 1;
} else if (fastcmp(word, "numextraemblems")) {
lua_pushinteger(L, numextraemblems);
return 1;
} else if (fastcmp(word, "gamestate")) {
lua_pushinteger(L, gamestate);
return 1;
......
......@@ -155,6 +155,8 @@ void M_ClearSecrets(gamedata_t *data)
data->unlocked[i] = false;
for (i = 0; i < MAXCONDITIONSETS; ++i)
data->achieved[i] = false;
for (i = 0; i < MAXLUACONDITIONS; ++i)
data->lua[i] = false;
data->timesBeaten = data->timesBeatenWithEmeralds = data->timesBeatenUltimate = 0;
......@@ -214,6 +216,8 @@ static UINT8 M_CheckCondition(condition_t *cn, gamedata_t *data)
return data->collected[cn->requirement-1];
case UC_EXTRAEMBLEM: // Requires extra emblem x to be obtained
return data->extraCollected[cn->requirement-1];
case UC_LUA:
return data->lua[cn->requirement-1];
case UC_CONDITIONSET: // requires condition set x to already be achieved
return M_Achieved(cn->requirement-1, data);
}
......
......@@ -47,6 +47,7 @@ typedef enum
UC_EMBLEM, // EMBLEM [emblem number]
UC_EXTRAEMBLEM, // EXTRAEMBLEM [extra emblem number]
UC_CONDITIONSET, // CONDITIONSET [condition set number]
UC_LUA, // LUA [condition set number]
} conditiontype_t;
// Condition Set information
......@@ -141,6 +142,7 @@ typedef struct
#define MAXEMBLEMS 512
#define MAXEXTRAEMBLEMS 48
#define MAXUNLOCKABLES 80
#define MAXLUACONDITIONS 128
/** Time attack information, currently a very small structure.
*/
......@@ -202,6 +204,9 @@ typedef struct
// UNLOCKABLES UNLOCKED
boolean unlocked[MAXUNLOCKABLES];
// LUA DATA (NOT SAVED INTO GAMEDATA)
boolean lua[MAXLUACONDITIONS];
// TIME ATTACK DATA
recorddata_t *mainrecords[NUMMAPS];
nightsdata_t *nightsrecords[NUMMAPS];
......
......@@ -186,6 +186,7 @@ static tic_t keydown = 0;
// Lua
static huddrawlist_h luahuddrawlist_playersetup;
static huddrawlist_h luahuddrawlist_infoscreen;
//
// PROTOTYPES
......@@ -393,6 +394,7 @@ static void M_DrawColorRamp(INT32 x, INT32 y, INT32 w, INT32 h, skincolor_t colo
// Handling functions
static boolean M_ExitPandorasBox(void);
static boolean M_QuitMultiPlayerMenu(void);
static boolean M_QuitPauseMenu(void);
static void M_HandleAddons(INT32 choice);
static void M_HandleLevelPlatter(INT32 choice);
static void M_HandleSoundTest(INT32 choice);
......@@ -3767,6 +3769,14 @@ void M_StartControlPanel(void)
CON_ToggleOff(); // move away console
}
static boolean M_QuitPauseMenu(void)
{
LUA_HUD_DestroyDrawList(luahuddrawlist_infoscreen);
luahuddrawlist_infoscreen = NULL;
return true;
}
void M_EndModeAttackRun(void)
{
G_ClearModeAttackRetryFlag();
......@@ -4719,8 +4729,32 @@ static void M_DrawPauseMenu(void)
emblem_t *emblem_detail[3] = {NULL, NULL, NULL};
char emblem_text[3][20];
INT32 i;
INT16 xbox = 27;
INT16 ybox = 16;
INT16 widthbox = 32;
INT16 heightbox = 6;
M_DrawTextBox(xbox, ybox, widthbox, heightbox);
M_DrawTextBox(27, 16, 32, 6);
if (!LUA_HUD_IsDrawListValid(luahuddrawlist_infoscreen))
{
LUA_HUD_DestroyDrawList(luahuddrawlist_infoscreen);
luahuddrawlist_infoscreen = LUA_HUD_CreateDrawList();
}
LUA_HUD_ClearDrawList(luahuddrawlist_infoscreen);
boolean esc_override = LUA_HookEscapePanel(
HUD_HOOK(escpanel),
luahuddrawlist_infoscreen,
xbox+5, ybox+5, widthbox*8+6, heightbox*8+6);
LUA_HUD_DrawList(luahuddrawlist_infoscreen);
if (esc_override)
{
M_DrawGenericMenu();
return;
}
// Draw any and all emblems at the top.
M_DrawMapEmblems(gamemap, 272, 28, true);
......@@ -4852,8 +4886,6 @@ static void M_DrawPauseMenu(void)
V_DrawRightAlignedString(284, 44 + (i*8), V_MONOSPACE, emblem_text[i]);
}
}
M_DrawGenericMenu();
}
static void M_DrawCenteredMenu(void)
......
......@@ -524,7 +524,7 @@ void M_FreePlayerSetupColors(void);
M_DrawPauseMenu,\
x, y,\
0,\
NULL\
M_QuitPauseMenu\
}
#define CENTERMENUSTYLE(id, header, source, prev, y)\
......