mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
Restructure inventory UI, add vendor selling, camera intro on all spawns, and quest log
Split inventory into bags-only (B key) and character screen (C key). Vendor window auto-opens bags with sell prices on hover and right-click to sell. Add camera intro pan on all login/spawn/teleport/hearthstone events and idle orbit after 2 minutes. Add quest log UI, SMSG_MONSTER_MOVE handling, deferred creature spawn queue, and creature fade-in/movement interpolation for online mode.
This commit is contained in:
parent
a4a39c7f0f
commit
7128ea1417
21 changed files with 1092 additions and 149 deletions
|
|
@ -60,6 +60,7 @@ void CameraController::startIntroPan(float durationSec, float orbitDegrees) {
|
|||
if (!camera) return;
|
||||
introActive = true;
|
||||
introTimer = 0.0f;
|
||||
idleTimer_ = 0.0f;
|
||||
introDuration = std::max(0.5f, durationSec);
|
||||
introStartYaw = facingYaw + orbitDegrees;
|
||||
introEndYaw = facingYaw;
|
||||
|
|
@ -96,9 +97,24 @@ void CameraController::update(float deltaTime) {
|
|||
bool ctrlDown = !uiWantsKeyboard && (input.isKeyPressed(SDL_SCANCODE_LCTRL) || input.isKeyPressed(SDL_SCANCODE_RCTRL));
|
||||
bool nowJump = !uiWantsKeyboard && !sitting && input.isKeyPressed(SDL_SCANCODE_SPACE);
|
||||
|
||||
// Idle camera: any input resets the timer; timeout triggers a slow orbit pan
|
||||
bool anyInput = leftMouseDown || rightMouseDown || keyW || keyS || keyA || keyD || keyQ || keyE || nowJump;
|
||||
if (anyInput) {
|
||||
idleTimer_ = 0.0f;
|
||||
} else if (!introActive) {
|
||||
idleTimer_ += deltaTime;
|
||||
if (idleTimer_ >= IDLE_TIMEOUT) {
|
||||
idleTimer_ = 0.0f;
|
||||
startIntroPan(6.0f, 360.0f); // Slow full orbit
|
||||
idleOrbit_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (introActive) {
|
||||
if (leftMouseDown || rightMouseDown || keyW || keyS || keyA || keyD || keyQ || keyE || nowJump) {
|
||||
if (anyInput) {
|
||||
introActive = false;
|
||||
idleOrbit_ = false;
|
||||
idleTimer_ = 0.0f;
|
||||
} else {
|
||||
introTimer += deltaTime;
|
||||
float t = (introDuration > 0.0f) ? std::min(introTimer / introDuration, 1.0f) : 1.0f;
|
||||
|
|
@ -109,7 +125,13 @@ void CameraController::update(float deltaTime) {
|
|||
camera->setRotation(yaw, pitch);
|
||||
facingYaw = yaw;
|
||||
if (t >= 1.0f) {
|
||||
introActive = false;
|
||||
if (idleOrbit_) {
|
||||
// Loop: restart the slow orbit continuously
|
||||
startIntroPan(6.0f, 360.0f);
|
||||
idleOrbit_ = true;
|
||||
} else {
|
||||
introActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Suppress player movement/input during intro.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue