Files
Goober5000 f733414403 make mission log dynamic (#6111)
* make mission log dynamic

Change the mission log from a static array to a dynamic vector.  This removes any chance of the mission log running into a limit (as regularly happened with the last mission of Shepherds before the limit bump) and also prevents strange mission bugs caused by culling obsolete entries.

This also unifies the API a bit by renaming the public `message_log_` function prefixes to `mission_log_`, removing the redundant `Num_log_lines` variable, and removing `Log_scrollback_vec` from the header.

Implements #5878.

* feedback

* refactor to reference rather than pointer
2024-06-13 00:17:47 +02:00

30 lines
611 B
C++

#pragma once
#include "mission/missionlog.h"
#include "hud/hudmessage.h"
#include "scripting/ade_api.h"
namespace scripting {
namespace api {
struct log_entry_h {
int section;
log_entry_h();
explicit log_entry_h(int l_section);
const log_line_complete* getSection() const;
bool isValid() const;
};
struct message_entry_h {
int section;
message_entry_h();
explicit message_entry_h(int l_section);
const line_node* getSection() const;
bool isValid() const;
};
DECLARE_ADE_OBJ(l_Log_Entry, log_entry_h);
DECLARE_ADE_OBJ(l_Message_Entry, message_entry_h);
} // namespace api
} // namespace scripting