Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/PC.md
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,25 @@ language's tabs. The kana keyboards are Japanese-only and not offered.
`name_mouse.cpp` is called from `pad_button_read`, ahead of the game's read of
the pad, so no function of `ps2/src` is replaced for it.

## The title menu, Exit and Quit

The title's menu has a fourth row, Exit, which asks "Return to desktop?" and closes the game on Yes.
Retail's three rows are painted pictures (`start.img` and its French, German, Italian and Spanish
copies) with no Exit among them, so all four are drawn through the UI framework
(`port/src/title/title_menu.cpp`) in Chronicle Title, whose capitals are the painted rows' own letters
fitted into the font, with retail's words as the `title.menu.*` keys, and coloured as the GS drew the painting:
the selected row the painting's cream, the rest that cream at half opacity (see "Matching retail's
2D look" in `docs/UI_FRAMEWORK.md`). The rows stand 28
pixels apart from 284, so the fourth clears the trademark lines; they keep retail's hand, blink and
sounds. Exit's row shares its number with the attract movie's,
which retail only sets on the way out, so `TitleLoop`'s handling of the other rows is retail's.

Quit in the pause menu, in a town or a dungeon, asks "Return to the title?" and on Yes goes back to
the title screen instead of the desktop. The main loop leaves the mode where it stands, as the
developer menu does (`TakeBattleMenuTitleRequest`, `port/src/gameloop.cpp`): it waits for loads in
flight, stops the sound and jumps to map 800, so the title starts as it does at start-up. Nothing is
saved on the way.

## The mouse in the pause menu

The pause menu (the ring of pages in a dungeon, and the same ring in town) takes the mouse as a
Expand Down
415 changes: 415 additions & 0 deletions docs/UI_FRAMEWORK.md

Large diffs are not rendered by default.

212 changes: 0 additions & 212 deletions docs/port/ui_framework.md

This file was deleted.

11 changes: 0 additions & 11 deletions port/include/ui_framework.hpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
#pragma once

#include <string>
#include <utility>
#include <vector>

#include "ui_framework/buttons.hpp"
#include "ui_framework/dialogs.hpp"
#include "ui_framework/surfaces.hpp"
#include "ui_framework/text.hpp"
#include "ui_framework/types.hpp"
#include "ui_framework/widgets.hpp"

namespace UI {

std::vector<std::pair<std::string, std::string>> BattleMenuStrings();
std::vector<std::pair<std::string, std::string>> JournalStrings();

} // namespace UI
13 changes: 13 additions & 0 deletions port/include/ui_framework/dialogs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,19 @@ class ConfirmModal {
std::string_view yes_label, std::string_view no_label,
int selected_choice, Cursor &cursor, int alpha = 0x80,
WindowPreset preset = WindowPreset::DarkTranslucent, int chosen_choice = -1, bool lit = false);

/**
* Returns the button of the modal Draw lays out for this title and description under the logical point (x, y):
* 0 for the first (yes), 1 for the second (no), -1 for neither. Each button's row of the stack counts, so the
* point need not be on the plate itself.
*/
static int Hit(std::string_view title, std::string_view description, float x, float y);

/**
* Returns where Draw puts a button (0 yes, 1 no) of the modal for this title and description, as for placing the
* hand cursor on one before the modal is first drawn: Draw aims it at 34 left of the plate and 3 below its top.
*/
static Rect ButtonRect(std::string_view title, std::string_view description, int button);
};

/**
Expand Down
Loading
Loading