Skip to content

Commit

Permalink
Swapped DisplayTasksOnLaunch to load when a character is loaded, ra…
Browse files Browse the repository at this point in the history
…ther than when the player launches into space, added a server setting to disable the login message.
  • Loading branch information
IrateRedKite authored and Lazrius committed Mar 6, 2024
1 parent 133907a commit 68e03f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 8 additions & 5 deletions plugins/daily_tasks/DailyTasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,10 +529,13 @@ namespace Plugins::DailyTasks
/** @ingroup DailyTasks
* @brief Hook on PlayerLaunch to display the task list when the player undocks.
*/
void DisplayTasksOnLaunch([[maybe_unused]] const uint& ship, ClientId& client)
void DisplayTasksOnLaunch([[maybe_unused]] const std::string_view& charFilename, ClientId& client)
{
PrintTasks(client);
PrintUserCmdText(client, L"To view this list again, type /showtasks in chat.");
if (global->config->displayMessage)
{
PrintTasks(client);
PrintUserCmdText(client, L"To view this list again, type /showtasks in chat.");
}
}

/** @ingroup DailyTasks
Expand Down Expand Up @@ -677,7 +680,7 @@ using namespace Plugins::DailyTasks;

REFL_AUTO(type(Config), field(taskQuantity), field(minCreditsReward), field(maxCreditsReward), field(itemRewardPool), field(taskTradeBaseTargets),
field(taskTradeItemTargets), field(taskItemAcquisitionTargets), field(taskNpcKillTargets), field(taskPlayerKillTargets), field(taskDuration),
field(resetTime));
field(resetTime), field(displayMessage));

REFL_AUTO(type(Tasks), field(tasks));

Expand All @@ -703,5 +706,5 @@ extern "C" EXPORT void ExportPluginInfo(PluginInfo* pi)
pi->emplaceHook(HookedCall::IEngine__ShipDestroyed, &ShipDestroyed);
pi->emplaceHook(HookedCall::IServerImpl__GFGoodSell, &ItemSold, HookStep::After);
pi->emplaceHook(HookedCall::IServerImpl__BaseEnter, &SaveTaskStatusOnBaseEnter, HookStep::After);
pi->emplaceHook(HookedCall::IServerImpl__PlayerLaunch, &DisplayTasksOnLaunch);
pi->emplaceHook(HookedCall::IServerImpl__CharacterSelect, &DisplayTasksOnLaunch);
}
2 changes: 2 additions & 0 deletions plugins/daily_tasks/DailyTasks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ namespace Plugins::DailyTasks
int resetTime = 12;
//! The amount of time in seconds a player has to complete a set of assigned tasks before they get cleaned up during the hourly check or at login.
int taskDuration = 86400;
//! Whether or not to display a message with daily task data when a player logs in.
bool displayMessage = true;
};

enum class TaskType
Expand Down

0 comments on commit 68e03f2

Please sign in to comment.