From 06043e738d9cb3c5af1318f41cc3969c07b2268e Mon Sep 17 00:00:00 2001 From: engsr6982 <109733049+engsr6982@users.noreply.github.com> Date: Tue, 23 Apr 2024 14:33:30 +0800 Subject: [PATCH] fixed motdManagement --- src/Form/function/MotdManagement.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Form/function/MotdManagement.cpp b/src/Form/function/MotdManagement.cpp index 0271599..ff5cd49 100644 --- a/src/Form/function/MotdManagement.cpp +++ b/src/Form/function/MotdManagement.cpp @@ -43,6 +43,7 @@ void EditMotd(Player& player, int index) { motd::motd_list[index] = value; + motd::saveMotd(); showMotd(pl, index); }); } @@ -55,13 +56,22 @@ void showMotd(Player& player, int index) { fm.appendButton("Edit"_tr(), [index](Player& pl) { EditMotd(pl, index); }); - fm.appendButton("Move Up"_tr(), [index](Player&) { moveVectorItem(MoveUp, index); }); + fm.appendButton("Move Up"_tr(), [index](Player& pl) { + moveVectorItem(MoveUp, index); + motd::saveMotd(); + motdManagement(pl); + }); - fm.appendButton("Move Down"_tr(), [index](Player&) { moveVectorItem(MoveDown, index); }); + fm.appendButton("Move Down"_tr(), [index](Player& pl) { + moveVectorItem(MoveDown, index); + motd::saveMotd(); + motdManagement(pl); + }); - fm.appendButton("Delete"_tr(), [index](Player&) { + fm.appendButton("Delete"_tr(), [index](Player& pl) { motd::motd_list.erase(motd::motd_list.begin() + index); motd::saveMotd(); + motdManagement(pl); }); fm.appendButton("Return"_tr(), [](Player& pl) { motdManagement(pl); });