Style changes #27
@@ -36,7 +36,7 @@ void GuiElementContainer::removeChild( GuiElement* element ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool GuiElementContainer::containsPointInChildren(int x, int y) const {
|
bool GuiElementContainer::containsPointInChildren(int x, int y) const {
|
||||||
for (std::vector<GuiElement*>::const_iterator it = children.begin(); it != children.end(); ++it) {
|
for (auto it = children.begin(); it != children.end(); ++it) {
|
||||||
GuiElement* child = *it;
|
GuiElement* child = *it;
|
||||||
if (child == NULL || !child->visible) continue;
|
if (child == NULL || !child->visible) continue;
|
||||||
if (child->pointInside(x, y)) return true;
|
if (child->pointInside(x, y)) return true;
|
||||||
|
|||||||
@@ -12,18 +12,7 @@
|
|||||||
#include "../../../platform/input/Mouse.h"
|
#include "../../../platform/input/Mouse.h"
|
||||||
#include "../../../util/Mth.h"
|
#include "../../../util/Mth.h"
|
||||||
|
|
||||||
OptionsGroup::OptionsGroup( std::string labelID )
|
OptionsGroup::OptionsGroup( std::string labelID ) {
|
||||||
: contentHeight(0),
|
|
||||||
scrollOffsetY(0.0f),
|
|
||||||
maxScrollOffsetY(0.0f),
|
|
||||||
trackingScrollGesture(false),
|
|
||||||
scrollingGesture(false),
|
|
||||||
touchDispatched(false),
|
|
||||||
dragStartX(0),
|
|
||||||
dragStartY(0),
|
|
||||||
lastDragY(0),
|
|
||||||
touchStartX(0),
|
|
||||||
touchStartY(0) {
|
|
||||||
label = I18n::get(labelID);
|
label = I18n::get(labelID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,7 +25,7 @@ void OptionsGroup::setupPositions() {
|
|||||||
const int contentStartY = y + labelHeight;
|
const int contentStartY = y + labelHeight;
|
||||||
|
|
||||||
// First we write the header and then we add the items
|
// First we write the header and then we add the items
|
||||||
for(std::vector<GuiElement*>::iterator it = children.begin(); it != children.end(); ++it) {
|
for(auto it = children.begin(); it != children.end(); ++it) {
|
||||||
(*it)->width = width - 5;
|
(*it)->width = width - 5;
|
||||||
|
|
||||||
(*it)->y = curY;
|
(*it)->y = curY;
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
#ifndef NET_MINECRAFT_CLIENT_GUI_COMPONENTS__OptionsGroup_H__
|
#ifndef NET_MINECRAFT_CLIENT_GUI_COMPONENTS__OptionsGroup_H__
|
||||||
#define NET_MINECRAFT_CLIENT_GUI_COMPONENTS__OptionsGroup_H__
|
#define NET_MINECRAFT_CLIENT_GUI_COMPONENTS__OptionsGroup_H__
|
||||||
|
|
||||||
//package net.minecraft.client.gui;
|
//package net.minecraft.client.gui;
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "GuiElementContainer.h"
|
#include "GuiElementContainer.h"
|
||||||
#include "ScrollingPane.h"
|
#include "ScrollingPane.h"
|
||||||
#include "../../Options.h"
|
#include "../../Options.h"
|
||||||
|
|
||||||
class Font;
|
class Font;
|
||||||
class Minecraft;
|
class Minecraft;
|
||||||
|
|
||||||
class OptionsGroup: public GuiElementContainer {
|
class OptionsGroup: public GuiElementContainer {
|
||||||
typedef GuiElementContainer super;
|
typedef GuiElementContainer super;
|
||||||
public:
|
public:
|
||||||
@@ -24,26 +24,26 @@ public:
|
|||||||
void scrollByPixels(float deltaY);
|
void scrollByPixels(float deltaY);
|
||||||
bool isScrollingGestureActive() const;
|
bool isScrollingGestureActive() const;
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void createToggle(OptionId optId, Minecraft* minecraft);
|
void createToggle(OptionId optId, Minecraft* minecraft);
|
||||||
void createProgressSlider(OptionId optId, Minecraft* minecraft);
|
void createProgressSlider(OptionId optId, Minecraft* minecraft);
|
||||||
void createStepSlider(OptionId optId, Minecraft* minecraft);
|
void createStepSlider(OptionId optId, Minecraft* minecraft);
|
||||||
void createTextbox(OptionId optId, Minecraft* minecraft);
|
void createTextbox(OptionId optId, Minecraft* minecraft);
|
||||||
void createKey(OptionId optId, Minecraft* minecraft);
|
void createKey(OptionId optId, Minecraft* minecraft);
|
||||||
|
|
||||||
std::string label;
|
std::string label;
|
||||||
int contentHeight;
|
int contentHeight = 0;
|
||||||
float scrollOffsetY;
|
float scrollOffsetY = 0.f;
|
||||||
float maxScrollOffsetY;
|
float maxScrollOffsetY = 0.f;
|
||||||
bool trackingScrollGesture;
|
bool trackingScrollGesture = false;
|
||||||
bool scrollingGesture;
|
bool scrollingGesture = false;
|
||||||
bool touchDispatched;
|
bool touchDispatched = false;
|
||||||
int dragStartX;
|
int dragStartX = 0;
|
||||||
int dragStartY;
|
int dragStartY = 0;
|
||||||
int lastDragY;
|
int lastDragY = 0;
|
||||||
int touchStartX;
|
int touchStartX = 0;
|
||||||
int touchStartY;
|
int touchStartY = 0;
|
||||||
static const int ScrollStartThreshold = 5;
|
static const int ScrollStartThreshold = 5;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*NET_MINECRAFT_CLIENT_GUI_COMPONENTS__OptionsGroup_H__*/
|
#endif /*NET_MINECRAFT_CLIENT_GUI_COMPONENTS__OptionsGroup_H__*/
|
||||||
|
|||||||
Reference in New Issue
Block a user