aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/AchievementScreen.h
blob: 3c4412e35e0a0b60ca57a29a89fea0f45ed5bf5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once
#include "Screen.h"
#include "..\Minecraft.World\net.minecraft.stats.h"
class StatsCounter;

class AchievementScreen : public Screen
{
private:
	static const int BIGMAP_X = 16;
    static const int BIGMAP_Y = 17;
    static const int BIGMAP_WIDTH = 224;
    static const int BIGMAP_HEIGHT = 155;

    // number of pixels per achievement
    static const int ACHIEVEMENT_COORD_SCALE = 24;
    static const int EDGE_VALUE_X = Achievements::ACHIEVEMENT_WIDTH_POSITION * ACHIEVEMENT_COORD_SCALE;
    static const int EDGE_VALUE_Y = Achievements::ACHIEVEMENT_HEIGHT_POSITION * ACHIEVEMENT_COORD_SCALE;

    int xMin;
    int yMin;
    int xMax;
    int yMax;

    static const int MAX_BG_TILE_Y = (EDGE_VALUE_Y * 2 - 1) / 16;

protected:
	int imageWidth;
    int imageHeight;
    int xLastScroll;
    int yLastScroll;

protected:
	double xScrollO, yScrollO;
    double xScrollP, yScrollP;
    double xScrollTarget, yScrollTarget;

private:
	int scrolling;
    StatsCounter *statsCounter;

public:
	using Screen::keyPressed;

	AchievementScreen(StatsCounter *statsCounter);
    virtual void init();
protected:
	virtual void buttonClicked(Button *button);
    virtual void keyPressed(char eventCharacter, int eventKey);
public:
	virtual void render(int mouseX, int mouseY, float a);
    virtual void tick();
protected:
	virtual void renderLabels();
    virtual void renderBg(int xm, int ym, float a);
public:
	virtual bool isPauseScreen();
};