diff --git a/About.h b/About.h index 6feb2e3..ad6e61b 100644 --- a/About.h +++ b/About.h @@ -10,7 +10,7 @@ using namespace System::Data; using namespace System::Drawing; -namespace MHXXASS { +namespace MHGUASS { public ref class About : public System::Windows::Forms::Form { diff --git a/Advanced.h b/Advanced.h index 5d4d303..266f2e7 100644 --- a/Advanced.h +++ b/Advanced.h @@ -13,7 +13,7 @@ using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; -namespace MHXXASS { +namespace MHGUASS { public ref class Advanced : public System::Windows::Forms::Form { @@ -25,13 +25,15 @@ namespace MHXXASS { const static Color color_default = Color::Black; const static Color color_enabled = Color::Green; const static Color color_disabled = Color::Gray; - bool manual_checking, want_taunt; + bool manual_checking, want_taunt, checking_neset; public: #pragma warning( disable : 4677 ) Advanced( Query^ query ) { manual_checking = false; + checking_neset = false; + want_taunt = query->want_taunt; InitializeComponent(); this->query = query; @@ -743,6 +745,23 @@ namespace MHXXASS { RecheckDefaultItems( sender ); manual_checking = true; + + if( !checking_neset && op->is_armor && safe_cast( op )->charm_up ) + UpdateNesetArmor( op->force_disable ); + } + + System::Void UpdateNesetArmor( const bool disabled ) + { + checking_neset = true; + + for( int i = 0; i < int( Armor::ArmorType::NumArmorTypes ); ++i ) + { + ListView^ lv = boxes[ i ]; + ListViewItem^ item = lv->Items[ lv->Items->Count - 1 ]; + item->Checked = !disabled; + } + + checking_neset = false; } System::Void contextMenuStrip1_Opening(System::Object^ sender, System::ComponentModel::CancelEventArgs^ e) @@ -757,11 +776,12 @@ namespace MHXXASS { else { List_t< Armor^ > preview_armors; - for( unsigned i = 0; i < 5; ++i ) + for( unsigned i = 0; i < unsigned( Armor::ArmorType::NumArmorTypes ); ++i ) { if( boxes[ i ]->Focused && boxes[ i ]->SelectedIndices->Count == 1 ) { - Armor^ armor = query->inf_armor[ i ][ boxes[ i ]->SelectedIndices[ 0 ] ]; + List_t< Armor^ >^ inf_armor = query->inf_armor[ i ]; + Armor^ armor = inf_armor[ boxes[ i ]->SelectedIndices[ 0 ] ]; Utility::UpdateContextMenu( contextMenuStrip1, armor ); e->Cancel = false; diff --git a/Armor.cpp b/Armor.cpp index 3d8a793..37a8e57 100644 --- a/Armor.cpp +++ b/Armor.cpp @@ -118,7 +118,9 @@ void Armor::Load( String^ filename, ArmorType armor_type ) armor->gender = split[ data_start ] == L"1" ? Gender::MALE : split[ data_start ] == L"2" ? Gender::FEMALE : Gender::BOTH_GENDERS; armor->type = split[ data_start + 1 ] == L"1" ? HunterType::BLADEMASTER : split[ data_start + 1 ] == L"2" ? HunterType::GUNNER : HunterType::BOTH_TYPES; armor->rarity = split[ data_start + 2 ] == L"X" ? 11 : Convert::ToInt32( split[ data_start + 2 ] ); + armor->is_helm = armor_type == ArmorType::HEAD; armor->is_event = false; + armor->is_armor = true; armor->num_slots = ConvertNum( split[ data_start + 3 ] ); @@ -269,7 +271,7 @@ bool Armor::MatchesQuery( Query^ query, List_t< Ability^ >^ danger_skills, const !query->allow_event && this->is_event || !query->allow_japs && this->jap_only || query->allow_japs && this->nonjap || - !query->allow_gunner_helms && this->gunner_def || + !query->allow_gunner_helms && this->gunner_def && this->is_helm || !query->allow_lower_tier && !relic && GetTier( this ) < GetTier( query->hr, this->elder_star ) || type != HunterType::BOTH_TYPES && query->hunter_type != type || gender != Gender::BOTH_GENDERS && gender != query->gender && !(jap_genders_only && !query->allow_japs) || diff --git a/Armor.h b/Armor.h index c660cd7..0d0f123 100644 --- a/Armor.h +++ b/Armor.h @@ -14,7 +14,7 @@ ref struct Armor : public AdvancedSearchOptions int ice_res, water_res, fire_res, thunder_res, dragon_res; Gender gender; HunterType type; - bool torso_inc, no_skills, is_event, jap_only, arena, chakra, jap_genders_only, nonjap, relic, gunner_def, hr_or, charm_up; + bool torso_inc, no_skills, is_event, jap_only, arena, chakra, jap_genders_only, nonjap, relic, gunner_def, hr_or, charm_up, is_helm; Ability^ danger; List_t< AbilityPair^ > abilities; List_t< MaterialComponent^ > components; diff --git a/Common.h b/Common.h index 1a74259..1b07252 100644 --- a/Common.h +++ b/Common.h @@ -18,7 +18,7 @@ ref struct Skill; ref struct AdvancedSearchOptions abstract { - bool force_enable, force_disable, default_piece; + bool force_enable, force_disable, default_piece, is_armor; unsigned adv_index; }; diff --git a/Decoration.cpp b/Decoration.cpp index 005b96f..f71609e 100644 Binary files a/Decoration.cpp and b/Decoration.cpp differ diff --git a/Find.h b/Find.h index 9684b15..adaa64b 100644 --- a/Find.h +++ b/Find.h @@ -9,7 +9,7 @@ using namespace System::Data; using namespace System::Drawing; -namespace MHXXASS { +namespace MHGUASS { public ref class Find : public System::Windows::Forms::Form { diff --git a/Form1.h b/Form1.h index dd1b572..11c46dd 100644 --- a/Form1.h +++ b/Form1.h @@ -10,7 +10,7 @@ #include "NumericUpDownHR.h" #include "PreviewImage.h" -namespace MHXXASS +namespace MHGUASS { using namespace System; using namespace System::ComponentModel; @@ -131,8 +131,8 @@ namespace MHXXASS private: System::Windows::Forms::TabPage^ tabGunner; private: System::Windows::Forms::GroupBox^ grpGSkillFilters; private: System::Windows::Forms::GroupBox^ grpGSkills; - private: MHXXASS::NumericUpDownHR^ nudHR; - private: MHXXASS::NumericUpDownVE^ nudElder; + private: MHGUASS::NumericUpDownHR^ nudHR; + private: MHGUASS::NumericUpDownVE^ nudElder; private: System::Windows::Forms::NumericUpDown^ nudWeaponSlots; private: System::Windows::Forms::GroupBox^ groupBox1; private: System::Windows::Forms::Label^ lblHR; @@ -831,12 +831,20 @@ namespace MHXXASS fout.WriteLine( bSkillFilters[ i ]->SelectedIndex ); if( bSkills[ i ]->SelectedIndex <= 0 ) fout.WriteLine( -1 ); - else fout.WriteLine( bIndexMaps[ i ][ bSkills[ i ]->SelectedIndex ] ); + else + { + Map_t< unsigned, unsigned >^ imap = bIndexMaps[ i ]; + fout.WriteLine( imap[ bSkills[ i ]->SelectedIndex ] ); + } fout.WriteLine( gSkillFilters[ i ]->SelectedIndex ); if( gSkills[ i ]->SelectedIndex <= 0 ) fout.WriteLine( -1 ); - else fout.WriteLine( gIndexMaps[ i ][ gSkills[ i ]->SelectedIndex ] ); + else + { + Map_t< unsigned, unsigned >^ imap = gIndexMaps[ i ]; + fout.WriteLine( imap[ gSkills[ i ]->SelectedIndex ] ); + } } const unsigned num_searched_skills = query ? query->skills.Count : 0; @@ -955,8 +963,8 @@ namespace MHXXASS this->nudWeaponSlots = ( gcnew System::Windows::Forms::NumericUpDown() ); this->lblElder = ( gcnew System::Windows::Forms::Label() ); this->lblSlots = ( gcnew System::Windows::Forms::Label() ); - this->nudHR = ( gcnew MHXXASS::NumericUpDownHR() ); - this->nudElder = ( gcnew MHXXASS::NumericUpDownVE() ); + this->nudHR = ( gcnew MHGUASS::NumericUpDownHR() ); + this->nudElder = ( gcnew MHGUASS::NumericUpDownVE() ); this->lblHR = ( gcnew System::Windows::Forms::Label() ); this->grpBSkills = ( gcnew System::Windows::Forms::GroupBox() ); this->btnSearch = ( gcnew System::Windows::Forms::Button() ); @@ -1727,6 +1735,7 @@ namespace MHXXASS query->allow_lower_tier = mnuAllowLowerTierArmor->Checked; query->add_extra = mnuSpendSpareSlots->Checked; query->allow_gunner_helms = mnuAllowGunnerHelms->Checked; + query->neset_disabled = false; query->want_taunt = false; for each( Skill^ s in skills ) @@ -1747,14 +1756,24 @@ namespace MHXXASS if( !use_gunner_skills ) { for( unsigned i = 0; i < NumSkills; ++i ) + { if( bSkills[ i ]->SelectedIndex >= 0 ) - skills.Add( data->FindSkill( bIndexMaps[ i ][ bSkills[ i ]->SelectedIndex ] ) ); + { + Map_t< unsigned, unsigned >^ imap = bIndexMaps[ i ]; + skills.Add( data->FindSkill( imap[ bSkills[ i ]->SelectedIndex ] ) ); + } + } } else { for( unsigned i = 0; i < NumSkills; ++i ) + { if( gSkills[ i ]->SelectedIndex >= 0 ) - skills.Add( data->FindSkill( gIndexMaps[ i ][ gSkills[ i ]->SelectedIndex ] ) ); + { + Map_t< unsigned, unsigned >^ imap = gIndexMaps[ i ]; + skills.Add( data->FindSkill( imap[ gSkills[ i ]->SelectedIndex ] ) ); + } + } } FormulateQuery( danger, use_gunner_skills, %skills ); @@ -1828,6 +1847,9 @@ namespace MHXXASS System::Void QueueTask2( Query^ query, List_t< Charm^ >^ cts ) { + if( query->neset_disabled ) + return; + BackgroundWorker^ new_thread = gcnew BackgroundWorker; new_thread->WorkerSupportsCancellation = true; new_thread->WorkerReportsProgress = true; @@ -1946,14 +1968,14 @@ namespace MHXXASS if( !to_search || to_search->Count == 0 ) { - if( query->hr >= 13 ) + if( query->AllowNesetArmor() ) QueueTask2( query, nullptr ); QueueTask( query, nullptr ); } else { - if( query->hr >= 13 ) + if( query->AllowNesetArmor() ) QueueTask2( query, to_search ); for each( Charm^ ct in to_search ) @@ -1968,9 +1990,20 @@ namespace MHXXASS System::Void btnAdvancedSearch_Click( System::Object^ sender, System::EventArgs^ e ) { - //updatedata(); - //return; FormulateQuery( true, tabHunterType->SelectedIndex == 1 ); + + array< Armor^ >^ neset_armors = query->hunter_type == HunterType::GUNNER ? Armor::charm_up_armors_g : Armor::charm_up_armors_b; + Assert( neset_armors->Length == int( Armor::ArmorType::NumArmorTypes ), L"Wrong number of Neset armors" ); + + if( query->AllowNesetArmor() ) + { + for( int i = 0; i < neset_armors->Length; ++i ) + { + query->rel_armor[ i ]->Add( neset_armors[ i ] ); + query->inf_armor[ i ]->Add( neset_armors[ i ] ); + } + } + Advanced advanced_search( query ); advanced_search.Width = adv_x; advanced_search.Height = adv_y; @@ -1983,13 +2016,28 @@ namespace MHXXASS if( advanced_search.DialogResult != System::Windows::Forms::DialogResult::OK ) return; + if( query->AllowNesetArmor() ) + { + query->neset_disabled = false; + for( int i = 0; i < neset_armors->Length; ++i ) + { + if( neset_armors[ i ]->force_disable ) + { + query->neset_disabled = true; + break; + } + } + } + for( int p = 0; p < int( Armor::ArmorType::NumArmorTypes ); ++p ) { query->rel_armor[ p ]->Clear(); - for( int i = 0; i < query->inf_armor[ p ]->Count; ++i ) + List_t< Armor^ >^ inf_armor = query->inf_armor[ p ]; + inf_armor->Remove( neset_armors[ p ] ); + for( int i = 0; i < inf_armor->Count; ++i ) { if( advanced_search.boxes[ p ]->Items[ i ]->Checked ) - query->rel_armor[ p ]->Add( query->inf_armor[ p ][ i ] ); + query->rel_armor[ p ]->Add( inf_armor[ i ] ); } } query->rel_decorations.Clear(); @@ -2031,7 +2079,8 @@ namespace MHXXASS if( skills[ i ]->SelectedIndex < 1 ) continue; - Skill^ skill = Skill::static_skills[ index_maps[ i ][ skills[ i ]->SelectedIndex ] ]; + Map_t< unsigned, unsigned >^ imap = index_maps[ i ]; + Skill^ skill = Skill::static_skills[ imap[ skills[ i ]->SelectedIndex ] ]; if( sender == skill_filters[ i ] ) selected_skill = skill; else old_skills.Add( skill->ability ); @@ -2083,7 +2132,8 @@ namespace MHXXASS } else { - selected_skill = Skill::static_skills[ index_maps[ index ][ skills[ index ]->SelectedIndex ] ]; + Map_t< unsigned, unsigned >^ imap = index_maps[ index ]; + selected_skill = Skill::static_skills[ imap[ skills[ index ]->SelectedIndex ] ]; //if( last_abilities[ index ] == selected_skill->ability ) // return; @@ -2108,14 +2158,16 @@ namespace MHXXASS if( i == index && skill_filters[ i ]->SelectedIndex != 2 ) continue; - Skill^ skill = skills[ i ]->SelectedIndex <= 0 ? nullptr : Skill::static_skills[ index_maps[ i ][ skills[ i ]->SelectedIndex ] ]; + Map_t< unsigned, unsigned >^ imap = index_maps[ i ]; + Skill^ skill = skills[ i ]->SelectedIndex <= 0 ? nullptr : Skill::static_skills[ imap[ skills[ i ]->SelectedIndex ] ]; List_t< Ability^ > old_skills; for( int j = 0; j < NumSkills; ++j ) { if( skills[ j ]->SelectedIndex <= 0 ) continue; - Skill^ os = Skill::static_skills[ index_maps[ j ][ skills[ j ]->SelectedIndex ] ]; + Map_t< unsigned, unsigned >^ jmap = index_maps[ j ]; + Skill^ os = Skill::static_skills[ jmap[ skills[ j ]->SelectedIndex ] ]; if( j != i ) old_skills.Add( os->ability ); @@ -2134,7 +2186,8 @@ namespace MHXXASS //check compound skills aren't overlapping their component skills for( int i = 0; i < NumSkills; ++i ) { - Skill^ skill = skills[ i ]->SelectedIndex <= 0 ? nullptr : Skill::static_skills[ index_maps[ i ][ skills[ i ]->SelectedIndex ] ]; + Map_t< unsigned, unsigned >^ imap = index_maps[ i ]; + Skill^ skill = skills[ i ]->SelectedIndex <= 0 ? nullptr : Skill::static_skills[ imap[ skills[ i ]->SelectedIndex ] ]; if( i != index && skill && selected_skill ) { if( Skill::CompoundSkillOverrides( skill, selected_skill ) || diff --git a/ImportCharms.h b/ImportCharms.h index 1a858bd..08b0733 100644 --- a/ImportCharms.h +++ b/ImportCharms.h @@ -11,7 +11,7 @@ using namespace System::Data; using namespace System::Drawing; -namespace MHXXASS { +namespace MHGUASS { public ref class ImportCharms : public System::Windows::Forms::Form { diff --git a/LoadedData.cpp b/LoadedData.cpp index ae3ccd8..fd434e2 100644 --- a/LoadedData.cpp +++ b/LoadedData.cpp @@ -122,7 +122,7 @@ void AddToList( List_t< Decoration^ >^ list, Decoration^ item, List_t< Ability^ void AddToList( List_t< Armor^ >^ list, Armor^ armor, List_t< Ability^ >^ rel_abilities, List_t< Armor^ >^ inf_armor, const bool adv, const bool want_taunt ) { - if( adv && armor->force_disable ) + if( adv && ( armor->force_disable || armor->charm_up ) ) return; const bool may_remove_self = !adv || !armor->force_enable; diff --git a/MHXX ASS.sln b/MHGU ASS.sln similarity index 100% rename from MHXX ASS.sln rename to MHGU ASS.sln diff --git a/MHXX ASS.cpp b/MHXX ASS.cpp index f676bef..0068595 100644 --- a/MHXX ASS.cpp +++ b/MHXX ASS.cpp @@ -3,7 +3,7 @@ #include "stdafx.h" #include "Form1.h" -using namespace MHXXASS; +using namespace MHGUASS; [STAThreadAttribute] int main(array ^args) diff --git a/MHXX ASS.vcxproj b/MHXX ASS.vcxproj index cbc9cf7..a03dad5 100644 --- a/MHXX ASS.vcxproj +++ b/MHXX ASS.vcxproj @@ -12,10 +12,11 @@ {A81954DD-AC39-4BA0-89B7-209D242373BF} - MHXXASS + MHGUASS ManagedCProj 10.0.15063.0 4.5 + MHGU ASS diff --git a/ManageCharms.h b/ManageCharms.h index 5aab20d..d1e4b2b 100644 --- a/ManageCharms.h +++ b/ManageCharms.h @@ -15,7 +15,7 @@ using namespace System::Drawing; #pragma warning( disable: 4677 ) //warning for passing my own class into this form -namespace MHXXASS { +namespace MHGUASS { public ref class ManageCharms : public System::Windows::Forms::Form { diff --git a/NumericUpDownHR.h b/NumericUpDownHR.h index b81874e..f4374c2 100644 Binary files a/NumericUpDownHR.h and b/NumericUpDownHR.h differ diff --git a/PreviewImage.h b/PreviewImage.h index 5842a18..d9d31a8 100644 --- a/PreviewImage.h +++ b/PreviewImage.h @@ -10,7 +10,7 @@ using namespace System::Data; using namespace System::Drawing; -namespace MHXXASS +namespace MHGUASS { public ref class PreviewImage : public System::Windows::Forms::Form diff --git a/SelectJapaneseSkill.h b/SelectJapaneseSkill.h index 9ecf815..96efacd 100644 --- a/SelectJapaneseSkill.h +++ b/SelectJapaneseSkill.h @@ -8,7 +8,7 @@ using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; -namespace MHXXASS +namespace MHGUASS { public ref class SelectJapaneseSkill : public System::Windows::Forms::Form { diff --git a/SkillHelp.h b/SkillHelp.h index 90bcc2e..649a444 100644 --- a/SkillHelp.h +++ b/SkillHelp.h @@ -11,7 +11,7 @@ using namespace System::Data; using namespace System::Drawing; -namespace MHXXASS +namespace MHGUASS { ref struct SubSkill { diff --git a/Solution.h b/Solution.h index 53181fd..aaae8d7 100644 --- a/Solution.h +++ b/Solution.h @@ -18,12 +18,14 @@ ref struct Query : public System::Object HunterType hunter_type; Gender gender; unsigned hr, elder_star, weapon_slots_allowed; - bool include_arena, allow_bad, allow_event, allow_lower_tier, allow_japs, add_extra, want_taunt, allow_gunner_helms; + bool include_arena, allow_bad, allow_event, allow_lower_tier, allow_japs, add_extra, want_taunt, allow_gunner_helms, neset_disabled; List_t< List_t< Armor^ >^ > rel_armor, inf_armor; List_t< Ability^ > rel_abilities; List_t< Decoration^ > rel_decorations, inf_decorations, taunt_decorations; + bool AllowNesetArmor() { return hr >= 13; } + template< class T > static bool HRMatches( T^ t, const unsigned hr, const unsigned ve ) {