Split votescreen stuff into its own file
This commit is contained in:
parent
dad79270d1
commit
dcdbd049e7
13 changed files with 1270 additions and 1191 deletions
|
|
@ -152,6 +152,7 @@ add_executable(BLANKART MACOSX_BUNDLE WIN32
|
|||
k_mapuser.c
|
||||
k_stats.c
|
||||
k_specialstage.c
|
||||
k_vote.c
|
||||
h_timers.cpp
|
||||
stun.c
|
||||
lonesha256.c
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@
|
|||
#include "r_fps.h"
|
||||
#include "m_cond.h" // netUnlocked
|
||||
#include "g_party.h"
|
||||
#include "k_vote.h"
|
||||
|
||||
// cl loading screen
|
||||
#include "v_video.h"
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@
|
|||
#include "m_random.h" // P_ClearRandom
|
||||
#include "acs/interface.h"
|
||||
#include "k_specialstage.h"
|
||||
#include "k_vote.h"
|
||||
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#include <inttypes.h>
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@
|
|||
#include "k_specialstage.h"
|
||||
#include "k_items.h"
|
||||
#include "k_itemlist.hpp"
|
||||
#include "k_vote.h"
|
||||
|
||||
#define CV_RESTRICT CV_NETVAR
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@
|
|||
#include "k_color.h"
|
||||
#include "k_follower.h"
|
||||
#include "k_grandprix.h"
|
||||
#include "k_vote.h"
|
||||
|
||||
static CV_PossibleValue_t recordmultiplayerdemos_cons_t[] = {{0, "Disabled"}, {1, "Manual Save"}, {2, "Auto Save"}, {0, NULL}};
|
||||
consvar_t cv_recordmultiplayerdemos = CVAR_INIT ("netdemo_record", "Manual Save", CV_SAVE, recordmultiplayerdemos_cons_t, NULL);
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@
|
|||
#include "g_party.h"
|
||||
#include "f_dscredits.hpp"
|
||||
#include "strbuf.h"
|
||||
#include "k_vote.h"
|
||||
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
#include "discord.h"
|
||||
|
|
|
|||
1183
src/k_vote.c
Normal file
1183
src/k_vote.c
Normal file
File diff suppressed because it is too large
Load diff
74
src/k_vote.h
Normal file
74
src/k_vote.h
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
// BLANKART
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2020 by Kart Krew.
|
||||
// Copyright (C) 2026 by Team BlanKart.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
// See the 'LICENSE' file for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file k_vote.h
|
||||
/// \brief MK online style voting screen
|
||||
|
||||
#ifndef __K_VOTE_H__
|
||||
#define __K_VOTE_H__
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void Y_VoteDrawer(void);
|
||||
void Y_VoteTicker(void);
|
||||
void Y_StartVote(void);
|
||||
void Y_EndVote(void);
|
||||
void Y_SetupVoteFinish(SINT8 pick, SINT8 level);
|
||||
|
||||
// Votescreen stuff
|
||||
typedef struct
|
||||
{
|
||||
boolean race; // non lua race patch replaced
|
||||
boolean widerace; // non lua widescreen race patch replaced
|
||||
boolean battle; // non lua battle patch replaced
|
||||
boolean widebattle; // non lua widescreen battle patch replaced
|
||||
} votereplace_t;
|
||||
|
||||
// VEXTRN - Vote (V) Extra (EXT) Race (R) Normal (N - Normal sized patch)
|
||||
// VEXTRW - Vote (V) Extra (EXT) Race (R) Normal (W - Wide patch)
|
||||
// VEXTBN - Vote (V) Extra (EXT) Battle (B) Normal (N - Normal sized patch)
|
||||
// VEXTBW - Vote (V) Extra (EXT) Battle (B) Normal (W - Wide patch)
|
||||
typedef struct
|
||||
{
|
||||
char Prefix[5]; // Race = INTSX, Battle = BTLSX
|
||||
char luaPrefix[5]; // prefix for lua votescreens
|
||||
|
||||
INT32 currentAnimFrame; // current animated background frame
|
||||
INT32 timePerAnimFrame; // time for 1 frame in ticks, 2 by default
|
||||
|
||||
INT32 foundLuaVoteFrames; // normal lua patch frames
|
||||
INT32 foundLuaVoteWideFrames; // widescreen lua patch frames
|
||||
|
||||
votereplace_t replaced; // checks which non lua patch has been replaced
|
||||
|
||||
patch_t *bgpatch; // votebackground patch
|
||||
patch_t *widebgpatch; // wide votebackground patch
|
||||
|
||||
patch_t *cursor[5]; // cursor patches
|
||||
patch_t *rubyicon; // encore ruby patch
|
||||
} votescreen_t;
|
||||
extern votescreen_t VoteScreen;
|
||||
|
||||
boolean Y_PlayerIDCanVote(const UINT8 id);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
VOTE_NOT_PICKED = -1,
|
||||
} votetype_e;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // __K_VOTE_H__
|
||||
|
|
@ -35,6 +35,7 @@
|
|||
|
||||
#include "k_hud.h"
|
||||
#include "h_timers.h"
|
||||
#include "k_vote.h"
|
||||
|
||||
#define HUDONLY if (!hud_running) return luaL_error(L, "HUD rendering code should not be called outside of rendering hooks!");
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@
|
|||
#include "g_party.h"
|
||||
#include "k_waypoint.h"
|
||||
#include "k_itemlist.hpp"
|
||||
#include "k_vote.h"
|
||||
|
||||
#include <tracy/tracy/TracyC.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@
|
|||
|
||||
#include "y_inter.h"
|
||||
|
||||
#include "k_vote.h"
|
||||
|
||||
// for MapLoad hook
|
||||
#include "lua_script.h"
|
||||
#include "lua_hook.h"
|
||||
|
|
|
|||
1147
src/y_inter.c
1147
src/y_inter.c
File diff suppressed because it is too large
Load diff
|
|
@ -30,12 +30,6 @@ void Y_CleanupScreenBuffer(void);
|
|||
|
||||
void Y_DetermineIntermissionType(void);
|
||||
|
||||
void Y_VoteDrawer(void);
|
||||
void Y_VoteTicker(void);
|
||||
void Y_StartVote(void);
|
||||
void Y_EndVote(void);
|
||||
void Y_SetupVoteFinish(SINT8 pick, SINT8 level);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
int_none,
|
||||
|
|
@ -46,46 +40,7 @@ typedef enum
|
|||
|
||||
extern intertype_t intertype;
|
||||
|
||||
// Votescreen stuff
|
||||
typedef struct
|
||||
{
|
||||
boolean race; // non lua race patch replaced
|
||||
boolean widerace; // non lua widescreen race patch replaced
|
||||
boolean battle; // non lua battle patch replaced
|
||||
boolean widebattle; // non lua widescreen battle patch replaced
|
||||
} votereplace_t;
|
||||
|
||||
// VEXTRN - Vote (V) Extra (EXT) Race (R) Normal (N - Normal sized patch)
|
||||
// VEXTRW - Vote (V) Extra (EXT) Race (R) Normal (W - Wide patch)
|
||||
// VEXTBN - Vote (V) Extra (EXT) Battle (B) Normal (N - Normal sized patch)
|
||||
// VEXTBW - Vote (V) Extra (EXT) Battle (B) Normal (W - Wide patch)
|
||||
typedef struct
|
||||
{
|
||||
char Prefix[5]; // Race = INTSX, Battle = BTLSX
|
||||
char luaPrefix[5]; // prefix for lua votescreens
|
||||
|
||||
INT32 currentAnimFrame; // current animated background frame
|
||||
INT32 timePerAnimFrame; // time for 1 frame in ticks, 2 by default
|
||||
|
||||
INT32 foundLuaVoteFrames; // normal lua patch frames
|
||||
INT32 foundLuaVoteWideFrames; // widescreen lua patch frames
|
||||
|
||||
votereplace_t replaced; // checks which non lua patch has been replaced
|
||||
|
||||
patch_t *bgpatch; // votebackground patch
|
||||
patch_t *widebgpatch; // wide votebackground patch
|
||||
|
||||
patch_t *cursor[5]; // cursor patches
|
||||
patch_t *rubyicon; // encore ruby patch
|
||||
} votescreen_t;
|
||||
extern votescreen_t VoteScreen;
|
||||
|
||||
boolean Y_PlayerIDCanVote(const UINT8 id);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
VOTE_NOT_PICKED = -1,
|
||||
} votetype_e;
|
||||
void Y_FollowIntermission(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
|
|
|||
Loading…
Reference in a new issue