Skip to content

Commit

Permalink
added quests to ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Dregu committed Sep 20, 2021
1 parent 9a53e63 commit 04337b7
Showing 1 changed file with 156 additions and 1 deletion.
157 changes: 156 additions & 1 deletion src/injected/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ std::vector<Player*> g_players;
bool set_focus_entity = false, set_focus_world = false, set_focus_zoom = false, scroll_to_entity = false, scroll_top = false, click_teleport = false,
throw_held = false, paused = false, show_app_metrics = false, lock_entity = false, lock_player = false,
freeze_last = false, freeze_level = false, freeze_total = false, hide_ui = false, dark_mode = false,
enable_noclip = false, hide_script_messages = false, fade_script_messages = true, load_script_dir = true, load_packs_dir = false, enable_camp_camera = true;
enable_noclip = false, hide_script_messages = false, fade_script_messages = true, load_script_dir = true, load_packs_dir = false, enable_camp_camera = true, freeze_quest_yang = false, freeze_quest_sisters = false, freeze_quest_horsing = false, freeze_quest_sparrow = false, freeze_quest_tusk = false, freeze_quest_beg = false;
std::optional<int8_t> quest_yang_state, quest_sisters_state, quest_horsing_state, quest_sparrow_state, quest_tusk_state, quest_beg_state;
Player* g_entity = 0;
Movable* g_held_entity = 0;
Inventory* g_inventory = 0;
Expand Down Expand Up @@ -4243,6 +4244,19 @@ void force_time()
{
g_state->time_total = g_total_time;
}

if (quest_yang_state.has_value())
g_state->quests->yang_state = quest_yang_state.value();
if (quest_sisters_state.has_value())
g_state->quests->jungle_sisters_flags = quest_sisters_state.value();
if (quest_horsing_state.has_value())
g_state->quests->van_horsing_state = quest_horsing_state.value();
if (quest_sparrow_state.has_value())
g_state->quests->sparrow_state = quest_sparrow_state.value();
if (quest_tusk_state.has_value())
g_state->quests->madame_tusk_state = quest_tusk_state.value();
if (quest_beg_state.has_value())
g_state->quests->beg_state = quest_beg_state.value();
}

void render_timer()
Expand Down Expand Up @@ -4350,6 +4364,147 @@ void render_game_props()
darkmode(dark_mode);
}
}
if (ImGui::CollapsingHeader("Quests"))
{
ImGui::Indent(16.0f);

if (ImGui::CollapsingHeader("Yang"))
{
if (ImGui::Checkbox("Freeze current state##FreezeQuestYang", &freeze_quest_yang))
{
if (freeze_quest_yang)
quest_yang_state = g_state->quests->yang_state;
else
quest_yang_state.reset();
}
int yang_state = static_cast<int>(g_state->quests->yang_state);
ImGui::RadioButton("Angry##QuestYangAngry", &yang_state, -1);
ImGui::RadioButton("Not started##QuestYangDefault", &yang_state, 0);
ImGui::RadioButton("Pen spawned##QuestYangPen", &yang_state, 2);
ImGui::RadioButton("Delivered##QuestYangDelivered", &yang_state, 3);
ImGui::RadioButton("Shop spawned##QuestYangShop", &yang_state, 4);
ImGui::RadioButton("1 turkey bought##QuestYang1", &yang_state, 5);
ImGui::RadioButton("2 turkeys bought##QuestYang2", &yang_state, 6);
ImGui::RadioButton("3 turkeys bought##QuestYang3", &yang_state, 7);
g_state->quests->yang_state = static_cast<int8_t>(yang_state);
}

if (ImGui::CollapsingHeader("Jungle Sisters"))
{
if (ImGui::Checkbox("Freeze current state##FreezeQuestSisters", &freeze_quest_sisters))
{
if (freeze_quest_sisters)
quest_sisters_state = g_state->quests->jungle_sisters_flags;
else
quest_sisters_state.reset();
}
int sisters_state = static_cast<int>(g_state->quests->jungle_sisters_flags);
bool angry = sisters_state == -1;
if (ImGui::Checkbox("Angry##QuestSistersAngry", &angry))
{
if (angry)
sisters_state = -1;
else
sisters_state = 0;
}
if (!angry)
{
ImGui::CheckboxFlags("Saved Parsley##QuestSistersParsley", &sisters_state, 1);
ImGui::CheckboxFlags("Saved Parsnip##QuestSistersParsnip", &sisters_state, 2);
ImGui::CheckboxFlags("Saved Parmesan##QuestSistersParmesan", &sisters_state, 4);
ImGui::CheckboxFlags("Met at Tide Pool door##QuestSistersTidePool", &sisters_state, 8);
ImGui::CheckboxFlags("Met in wet fur##QuestSistersIceCaves", &sisters_state, 32);
ImGui::CheckboxFlags("Met it palace##QuestSistersNeoBabylon", &sisters_state, 16);
g_state->quests->jungle_sisters_flags = static_cast<int8_t>(sisters_state);
}
}

if (ImGui::CollapsingHeader("Van Horsing"))
{
if (ImGui::Checkbox("Freeze current state##FreezeQuestHorsing", &freeze_quest_horsing))
{
if (freeze_quest_horsing)
quest_horsing_state = g_state->quests->van_horsing_state;
else
quest_horsing_state.reset();
}
int horsing_state = static_cast<int>(g_state->quests->van_horsing_state);
ImGui::RadioButton("Angry##QuestHorsingAngry", &horsing_state, -1);
ImGui::RadioButton("Not started##QuestHorsingDefault", &horsing_state, 0);
ImGui::RadioButton("Cell spawned##QuestHorsingCell", &horsing_state, 1);
ImGui::RadioButton("Got diamond##QuestHorsingDiamond", &horsing_state, 2);
ImGui::RadioButton("Spawned in Castle##QuestHorsingVlad", &horsing_state, 3);
ImGui::RadioButton("Shot Vlad##QuestHorsingVladShot", &horsing_state, 4);
ImGui::RadioButton("Spawned in Temple##QuestHorsingTemple", &horsing_state, 5);
ImGui::RadioButton("Got alien compass##QuestHorsingComplass", &horsing_state, 6);
ImGui::RadioButton("Palace basement ending##QuestHorsingTusk", &horsing_state, 7);
g_state->quests->van_horsing_state = static_cast<int8_t>(horsing_state);
}

if (ImGui::CollapsingHeader("Sparrow"))
{
if (ImGui::Checkbox("Freeze current state##FreezeQuestSparrow", &freeze_quest_sparrow))
{
if (freeze_quest_sparrow)
quest_sparrow_state = g_state->quests->sparrow_state;
else
quest_sparrow_state.reset();
}
int sparrow_state = static_cast<int>(g_state->quests->sparrow_state);
ImGui::RadioButton("Angry##QuestSparrowAngry", &sparrow_state, -1);
ImGui::RadioButton("Not started##QuestSparrowDefault", &sparrow_state, 0);
ImGui::RadioButton("Thief##QuestSparrowThief", &sparrow_state, 1);
ImGui::RadioButton("Finished level as thief##QuestSparrowThiefLevel", &sparrow_state, 2);
ImGui::RadioButton("Spawned in first hideout##QuestSparrowFirst", &sparrow_state, 3);
ImGui::RadioButton("Got ropes##QuestSparrowRopes", &sparrow_state, 4);
ImGui::RadioButton("Stole Tusk idol##QuestSparrowTusk", &sparrow_state, 5);
ImGui::RadioButton("Spawned in Neo Babylon##QuestSparrowSecond", &sparrow_state, 6);
ImGui::RadioButton("Met in Neo Babylon##QuestSparrowSecondComplete", &sparrow_state, 7);
ImGui::RadioButton("Palace basement ending##QuestSparrowTusk", &sparrow_state, 8);
g_state->quests->sparrow_state = static_cast<int8_t>(sparrow_state);
}

if (ImGui::CollapsingHeader("Madame Tusk"))
{
if (ImGui::Checkbox("Freeze current state##FreezeQuestTusk", &freeze_quest_tusk))
{
if (freeze_quest_tusk)
quest_tusk_state = g_state->quests->madame_tusk_state;
else
quest_tusk_state.reset();
}
int tusk_state = static_cast<int>(g_state->quests->madame_tusk_state);
ImGui::RadioButton("Angry##QuestTuskAngry", &tusk_state, -2);
ImGui::RadioButton("Dead##QuestTuskDead", &tusk_state, -1);
ImGui::RadioButton("Not started##QuestTuskDefault", &tusk_state, 0);
ImGui::RadioButton("Dice house spawned##QuestTuskDice", &tusk_state, 1);
ImGui::RadioButton("High roller##QuestTuskHighRoller", &tusk_state, 2);
ImGui::RadioButton("Palace ending##QuestTuskPalace", &tusk_state, 3);
g_state->quests->madame_tusk_state = static_cast<int8_t>(tusk_state);
}

if (ImGui::CollapsingHeader("Beg"))
{
if (ImGui::Checkbox("Freeze current state##FreezeQuestBeg", &freeze_quest_beg))
{
if (freeze_quest_beg)
quest_beg_state = g_state->quests->beg_state;
else
quest_beg_state.reset();
}
int beg_state = static_cast<int>(g_state->quests->beg_state);
ImGui::RadioButton("Angry##QuestBegAngry", &beg_state, -1);
ImGui::RadioButton("Not started##QuestBegDefault", &beg_state, 0);
ImGui::RadioButton("Altar destroyed##QuestBegAltar", &beg_state, 1);
ImGui::RadioButton("Spawned with bombs##QuestBegBombs", &beg_state, 2);
ImGui::RadioButton("Got bombs##QuestBegGotBombs", &beg_state, 3);
ImGui::RadioButton("Spawned with true crown##QuestBegCrown", &beg_state, 4);
ImGui::RadioButton("Got true crown##QuestBegGotCrown", &beg_state, 5);
g_state->quests->beg_state = static_cast<int8_t>(beg_state);
}

ImGui::Unindent(16.0f);
}
if (ImGui::CollapsingHeader("Street cred"))
{
ImGui::DragScalar("Shoppie aggro##ShoppieAggro", ImGuiDataType_U8, &g_state->shoppie_aggro, 0.5f, &u8_min, &u8_max, "%d");
Expand Down

0 comments on commit 04337b7

Please sign in to comment.