Skip to content

Commit

Permalink
Merge pull request #76 from titisee5/main
Browse files Browse the repository at this point in the history
Difficulty search parameter, Fix for show awards
  • Loading branch information
GreepTheSheep authored May 26, 2023
2 parents 502029e + 63d1050 commit a5fc979
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/Settings/SearchingParameters.as
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ namespace PluginSettings
[Setting hidden]
bool TagInclusiveSearch = false;

const array<string> SearchingDifficultys = {
"Anything",
"Beginner",
"Intermediate",
"Advanced",
"Expert",
"Lunatic",
"Impossible"
};

[Setting hidden]
string Difficulty = SearchingDifficultys[0];

[SettingsTab name="Searching"]
void RenderSearchingSettingTab()
{
Expand Down Expand Up @@ -150,6 +163,24 @@ namespace PluginSettings

MapTags = ConvertArrayToList(MapTagsArr);
ExcludeMapTags = ConvertArrayToList(ExcludeMapTagsArr);

UI::NewLine();

UI::SetNextItemWidth(160);
if (UI::BeginCombo("Difficulty", Difficulty)){
for (uint i = 0; i < SearchingDifficultys.Length; i++) {
string difficulty = SearchingDifficultys[i];

if (UI::Selectable(difficulty, Difficulty == difficulty)) {
Difficulty = difficulty;
}

if (Difficulty == difficulty) {
UI::SetItemDefaultFocus();
}
}
UI::EndCombo();
}
}

array<int> ToggleMapTag(array<int> tags, int tagID)
Expand Down
3 changes: 3 additions & 0 deletions src/Utils/MX/Methods/LoadRandomMap.as
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ namespace MX
if (PluginSettings::TagInclusiveSearch){
url += "&tagsinc=1";
}
if (PluginSettings::Difficulty != "Anything"){
url += "&difficulty=" + (PluginSettings::SearchingDifficultys.Find(PluginSettings::Difficulty)-1);
}
}

#if TMNEXT
Expand Down
4 changes: 4 additions & 0 deletions src/Utils/RMC/RMT.as
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ class RMT : RMC
UI::Separator();
if (currentMap !is null) {
UI::Text(currentMap.Name);
if (PluginSettings::RMC_ShowAwards) {
UI::SameLine();
UI::Text("\\$db4" + Icons::Trophy + "\\$z " + currentMap.AwardCount);
}
if(PluginSettings::RMC_DisplayMapDate) {
UI::TextDisabled(IsoDateToDMY(currentMap.UpdatedAt));
UI::SameLine();
Expand Down

0 comments on commit a5fc979

Please sign in to comment.