diff --git a/assets/alice.csv b/assets/alice.csv index 2a7a1499b..703e346f2 100644 --- a/assets/alice.csv +++ b/assets/alice.csv @@ -1092,6 +1092,8 @@ msg_crisis_defender_1;$x$ has become involved in the current crisis, backing the msg_crisis_vol_join_title;Nation Takes a Side msg_crisis_vol_join_1;$x$ has decided to join the current crisis on the side of the attackers. msg_crisis_vol_join_2;$x$ has decided to join the current crisis on the side of the defenders. +msg_entered_automatic_alliance_title;Entered alliance automatically +msg_entered_automatic_alliance_1;$x$ has entered in an alliance with us automatically, because we marked that we're interested in allying them if possible msg_n_event_title;National Event msg_p_event_title;Provincial Event msg_m_event_title;Major Event @@ -1387,6 +1389,7 @@ amsg_crisis_voluntary_join;The nation joins a crisis without an offer;;;;;;;;;;; amsg_army_built;The nation built an army;;;;;;;;;;;;x amsg_navy_built;The nation built a navy;;;;;;;;;;;;x amsg_bankruptcy;Nation goes bankrupt;;;;;;;;;;;;x +amsg_entered_automatic_alliance_title;The nation is automatically allied by another alice_stockpile_button_0_0;National stockpiles function as a condiment to your usual economic-business activities, where people see §Ggreen§W lines go up, and §Rred§W lines go down, as per usual I'm §Ynot§W a line graph so I mostly go unnoticed :) alice_stockpile_button_1_0;If you click me 10 times you will receive nothing in return, just trust me, don't click me... §ROR ELSE§W alice_stockpile_button_1_1;I see, well now I'm not gonna say anything because I know you will keep clicking until I say a §Ydifferent§W dialogue and that's just boring diff --git a/src/ai/ai.cpp b/src/ai/ai.cpp index fb966a121..8a3f126a2 100644 --- a/src/ai/ai.cpp +++ b/src/ai/ai.cpp @@ -165,6 +165,16 @@ void form_alliances(sys::state& state) { else return a.index() > b.index(); }); + if(state.world.nation_get_is_player_controlled(alliance_targets[0])) { + notification::post(state, notification::message{ + [source = n](sys::state& state, text::layout_base& contents) { + text::add_line(state, contents, "msg_entered_automatic_alliance_1", text::variable_type::x, source); + }, + "msg_entered_automatic_alliance_title", + n, dcon::nation_id{}, dcon::nation_id{}, + sys::message_base_type::crisis_voluntary_join + }); + } nations::make_alliance(state, n, alliance_targets[0]); } } diff --git a/src/common_types/constants.hpp b/src/common_types/constants.hpp index a2447a1bb..711498c0c 100644 --- a/src/common_types/constants.hpp +++ b/src/common_types/constants.hpp @@ -299,6 +299,7 @@ enum class message_setting_type : uint8_t { army_built = 98, // added navy_built = 99, // added bankruptcy = 100, + entered_automatic_alliance = 101, count = 128 }; @@ -375,6 +376,7 @@ enum class message_base_type : uint8_t { army_built = 69, // added navy_built = 70, // added bankruptcy = 71, + entered_automatic_alliance = 72, count = 72 }; @@ -496,6 +498,7 @@ constexpr inline msg_setting_entry message_setting_map[size_t(message_base_type: msg_setting_entry{ message_setting_type::army_built, message_setting_type::count, message_setting_type::count}, //army_built = 69, // added msg_setting_entry{ message_setting_type::navy_built, message_setting_type::count, message_setting_type::count}, //navy_built = 70, // added msg_setting_entry{ message_setting_type::bankruptcy, message_setting_type::count, message_setting_type::count }, // bankruptcy = 71, + msg_setting_entry{ message_setting_type::entered_automatic_alliance, message_setting_type::count, message_setting_type::count },//entered_automatic_alliance = 72, }; namespace message_response { diff --git a/src/gamestate/system_state.hpp b/src/gamestate/system_state.hpp index 9d3b2b5f3..e65e6c23d 100644 --- a/src/gamestate/system_state.hpp +++ b/src/gamestate/system_state.hpp @@ -155,6 +155,7 @@ struct user_settings_s { message_response::standard_log,//army_built = 98, message_response::standard_log,//navy_built = 99, message_response::standard_popup,//bankruptcy = 100, + message_response::standard_popup,//entered_automatic_alliance = 101, }; uint8_t interesting_message_settings[int32_t(sys::message_setting_type::count)] = { message_response::standard_log,//revolt = 0, @@ -258,6 +259,7 @@ struct user_settings_s { message_response::ignore,//army_built = 98, message_response::ignore,//navy_built = 99, message_response::standard_popup,//bankruptcy = 100, + message_response::ignore,//entered_automatic_alliance = 101, }; uint8_t other_message_settings[int32_t(sys::message_setting_type::count)] = { message_response::ignore,//revolt = 0, @@ -361,6 +363,7 @@ struct user_settings_s { message_response::ignore,//army_built = 98, message_response::ignore,//navy_built = 99, message_response::standard_popup,//bankruptcy = 100, + message_response::ignore,//entered_automatic_alliance = 101, }; bool fow_enabled = false; map_label_mode map_label = map_label_mode::quadratic; diff --git a/src/gui/gui_message_settings_window.hpp b/src/gui/gui_message_settings_window.hpp index 06b991bbf..26123c884 100644 --- a/src/gui/gui_message_settings_window.hpp +++ b/src/gui/gui_message_settings_window.hpp @@ -109,6 +109,7 @@ inline std::string get_setting_text_key(int32_t type) { "amsg_army_built", // army_built "amsg_navy_built", // navy_built "amsg_bankruptcy", //bankruptcy + "amsg_entered_automatic_alliance",//entered_automatic_alliance }; return std::string{key_str[type]}; }