wowie
Some checks failed
Build / Build Game (push) Has been cancelled

This commit is contained in:
2026-02-28 22:24:06 -05:00
parent 3817f1cc39
commit bc8fe78fce
14 changed files with 102 additions and 42 deletions

View File

@@ -24,14 +24,14 @@ namespace game::state
: World::CENTER;
}
void Main::set(Resources& resources, int characterIndex, enum Game game)
void Main::set(Resources& resources, int selectedCharacterIndex, enum Game game)
{
auto& data = resources.character_get(characterIndex);
auto& data = resources.character_get(selectedCharacterIndex);
auto& saveData = data.save;
auto& itemSchema = data.itemSchema;
auto& dialogue = data.dialogue;
auto& menuSchema = data.menuSchema;
this->characterIndex = characterIndex;
this->characterIndex = selectedCharacterIndex;
character =
entity::Character(data, vec2(World::BOUNDS.x + World::BOUNDS.z * 0.5f, World::BOUNDS.w - World::BOUNDS.y));
@@ -114,7 +114,7 @@ namespace game::state
save(resources);
}
void Main::tick(Resources& resources)
void Main::tick(Resources&)
{
character.tick();
cursor.tick();

View File

@@ -7,7 +7,7 @@ using namespace game::util::imgui;
namespace game::state::main
{
void Chat::update(Resources& resources, Text& text, entity::Character& character)
void Chat::update(Resources&, Text& text, entity::Character& character)
{
auto& dialogue = character.data.dialogue;
auto size = ImGui::GetContentRegionAvail();

View File

@@ -11,7 +11,7 @@ using namespace game::util;
namespace game::state::main
{
void Cheats::update(Resources& resources, entity::Character& character, Inventory& inventory, Text& text)
void Cheats::update(Resources&, entity::Character& character, Inventory& inventory, Text& text)
{
static constexpr auto FEED_INCREMENT = 100.0f;
@@ -40,7 +40,7 @@ namespace game::state::main
}
auto stage = character.stage + 1;
if (WIDGET_FX(ImGui::SliderInt("Stage", &stage, 1, character.data.stages.size() + 1)))
if (WIDGET_FX(ImGui::SliderInt("Stage", &stage, 1, (int)character.data.stages.size() + 1)))
{
character.stage = glm::clamp(0, stage - 1, (int)character.data.stages.size());
character.weight =

View File

@@ -129,7 +129,7 @@ namespace game::state::main
{
if (grade.isFailure) continue;
auto scale = powf(0.5f, rangeCount);
auto scale = powf(0.5f, (float)rangeCount);
auto halfHeight = baseHeight * scale * 0.5f;
rangeCount++;
@@ -165,19 +165,19 @@ namespace game::state::main
auto lineMin = ImVec2(barMin.x - LINE_WIDTH_BONUS, barMin.y + (barHeight * tryValue));
auto lineMax = ImVec2(barMin.x + barWidth + LINE_WIDTH_BONUS, lineMin.y + LINE_HEIGHT);
auto color = LINE_COLOR;
color.w = isActive ? 1.0f : endTimerProgress;
drawList->AddRectFilled(lineMin, lineMax, ImGui::GetColorU32(color));
auto lineColor = LINE_COLOR;
lineColor.w = isActive ? 1.0f : endTimerProgress;
drawList->AddRectFilled(lineMin, lineMax, ImGui::GetColorU32(lineColor));
if (!isActive && !isGameOver)
{
range_draw(queuedChallenge.range, 1.0f - endTimerProgress);
auto lineMin = ImVec2(barMin.x - LINE_WIDTH_BONUS, barMin.y + (barHeight * queuedChallenge.tryValue));
auto lineMax = ImVec2(barMin.x + barWidth + LINE_WIDTH_BONUS, lineMin.y + LINE_HEIGHT);
auto color = LINE_COLOR;
color.w = 1.0f - endTimerProgress;
drawList->AddRectFilled(lineMin, lineMax, ImGui::GetColorU32(color));
auto queuedLineMin = ImVec2(barMin.x - LINE_WIDTH_BONUS, barMin.y + (barHeight * queuedChallenge.tryValue));
auto queuedLineMax = ImVec2(barMin.x + barWidth + LINE_WIDTH_BONUS, queuedLineMin.y + LINE_HEIGHT);
auto queuedLineColor = LINE_COLOR;
queuedLineColor.w = 1.0f - endTimerProgress;
drawList->AddRectFilled(queuedLineMin, queuedLineMax, ImGui::GetColorU32(queuedLineColor));
}
if (isActive)
@@ -375,10 +375,10 @@ namespace game::state::main
toastMessage.position.y -= TOAST_MESSAGE_SPEED;
auto color = ImGui::GetStyleColorVec4(ImGuiCol_Text);
color.w = ((float)toastMessage.time / toastMessage.timeMax);
auto textColor = ImGui::GetStyleColorVec4(ImGuiCol_Text);
textColor.w = ((float)toastMessage.time / toastMessage.timeMax);
drawList->AddText(toastMessage.position, ImGui::GetColorU32(color), toastMessage.message.c_str());
drawList->AddText(toastMessage.position, ImGui::GetColorU32(textColor), toastMessage.message.c_str());
toastMessage.time--;

View File

@@ -28,18 +28,18 @@ namespace game::state::main
return it;
}
void Text::set(resource::xml::Dialogue::Entry* entry, entity::Character& character)
void Text::set(resource::xml::Dialogue::Entry* dialogueEntry, entity::Character& character)
{
if (!entry) return;
this->entry = entry;
if (!dialogueEntry) return;
this->entry = dialogueEntry;
isFinished = false;
index = 0;
time = 0.0f;
isEnabled = true;
character.isTalking = true;
if (!entry->animation.empty()) character.play_convert(entry->animation);
if (entry->text.empty()) isEnabled = false;
if (!dialogueEntry->animation.empty()) character.play_convert(dialogueEntry->animation);
if (dialogueEntry->text.empty()) isEnabled = false;
}
void Text::tick(entity::Character& character)
@@ -98,7 +98,7 @@ namespace game::state::main
auto font = ImGui::GetFont();
auto fontSize = resource::Font::NORMAL;
ImGui::PushFont(font, fontSize);
ImGui::PushFont(font, (float)fontSize);
auto text = [&]()
{
@@ -129,7 +129,7 @@ namespace game::state::main
if (!entry->choices.empty())
{
ImGui::SetCursorPos(ImVec2(ImGui::GetStyle().WindowPadding.x, available.y));
auto buttonSize = imgui::row_widget_size_get(entry->choices.size());
auto buttonSize = imgui::row_widget_size_get((int)entry->choices.size());
for (auto& branch : entry->choices)
{

View File

@@ -15,7 +15,7 @@ namespace game::state
characters.update(resources, characterIndex);
}
void Select::render(Resources& resources, Canvas& canvas)
void Select::render(Resources&, Canvas& canvas)
{
canvas.bind();
ImGui::Render();

View File

@@ -114,11 +114,11 @@ namespace game::state::select
if (ImGui::BeginPopupModal("New Game Warning", &isNewGameWarning,
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize))
{
auto widgetSize = row_widget_size_get(save.is_valid() ? 2 : 1);
auto popupWidgetSize = row_widget_size_get(save.is_valid() ? 2 : 1);
ImGui::TextWrapped("This will delete saved progress! Are you sure?");
if (WIDGET_FX(ImGui::Button("Yes", widgetSize))) isNewGame = true;
if (WIDGET_FX(ImGui::Button("Yes", popupWidgetSize))) isNewGame = true;
ImGui::SameLine();
if (WIDGET_FX(ImGui::Button("No", widgetSize))) isNewGameWarning = false;
if (WIDGET_FX(ImGui::Button("No", popupWidgetSize))) isNewGameWarning = false;
ImGui::EndPopup();
}
}

View File

@@ -52,12 +52,12 @@ namespace game::state::select
? 0.0f
: std::min(availableSize.x / textureSize.x, availableSize.y / textureSize.y);
auto size = ImVec2(textureSize.x * scale, textureSize.y * scale);
auto renderSize = ImVec2(textureSize.x * scale, textureSize.y * scale);
ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPosX() + (availableSize.x * 0.5f) - (size.y * 0.5f),
ImGui::GetCursorPosY() + (availableSize.y * 0.5f) - (size.y * 0.5f)));
ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPosX() + (availableSize.x * 0.5f) - (renderSize.y * 0.5f),
ImGui::GetCursorPosY() + (availableSize.y * 0.5f) - (renderSize.y * 0.5f)));
ImGui::Image(character.render.id, size);
ImGui::Image(character.render.id, renderSize);
ImGui::EndTabItem();
}