# 0.3.0
- Fix minor issues - Add Custom UV Support to Drawlist and Menu Image - Add DoubleClick to IO Input API - Add Flashbang Theme (Not completly done) - Fix Menu glitch when scrolling was possible when not allowed
This commit is contained in:
@ -37,9 +37,10 @@ class Image : public Container {
|
||||
* @param img Image Texture Reference
|
||||
* @param size Custom Size of the Image
|
||||
*/
|
||||
Image(Texture::Ref img, vec2 size = 0.f) {
|
||||
Image(Texture::Ref img, vec2 size = 0.f, LI::Rect uv = vec4(0.f)) {
|
||||
this->img = img;
|
||||
this->newsize = size;
|
||||
this->cuv = uv;
|
||||
if (size.x() != 0 || size.y() != 0) {
|
||||
this->SetSize(size);
|
||||
} else {
|
||||
@ -57,6 +58,7 @@ class Image : public Container {
|
||||
private:
|
||||
Texture::Ref img; ///< Texture reference to the Image
|
||||
vec2 newsize = 0.f; ///< New Size
|
||||
LI::Rect cuv; ///< Custom UV
|
||||
};
|
||||
} // namespace UI7
|
||||
} // namespace PD
|
@ -69,8 +69,10 @@ class DrawList : public SmartCtor<DrawList> {
|
||||
* @param pos Position
|
||||
* @param img Image Texture Reference
|
||||
* @param size Optional Size of the Image
|
||||
* @param uv Custom UV coords
|
||||
*/
|
||||
void AddImage(vec2 pos, Texture::Ref img, vec2 size = 0.f);
|
||||
void AddImage(vec2 pos, Texture::Ref img, vec2 size = 0.f,
|
||||
LI::Rect uv = vec4(0.f));
|
||||
/**
|
||||
* Render a Line from Position A to Position B
|
||||
* @param a Pos a
|
||||
|
@ -57,7 +57,10 @@ class ID {
|
||||
~ID() = default;
|
||||
|
||||
/** Get The ID Initial Name */
|
||||
std::string GetName() const { return name; }
|
||||
const std::string& GetName() const { return name; }
|
||||
|
||||
/** Getter for the raw 32bit int id */
|
||||
const u32& RawID() const { return id; }
|
||||
|
||||
/** Return the ID when casting to u32 */
|
||||
operator u32() const { return id; }
|
||||
|
@ -69,19 +69,13 @@ class IO : public SmartCtor<IO> {
|
||||
vec2 MenuPadding = 5.f;
|
||||
vec2 FramePadding = 5.f;
|
||||
vec2 ItemSpace = vec2(5.f, 2.f);
|
||||
u64 DoubleClickTime = 500; // Milliseconds
|
||||
std::vector<std::pair<UI7::ID, DrawList::Ref>> DrawListRegestry;
|
||||
DrawList::Ref Back;
|
||||
DrawList::Ref Front;
|
||||
u32 NumVertices = 0; ///< Debug Vertices Num
|
||||
u32 NumIndices = 0; ///< Debug Indices Num
|
||||
|
||||
// Layer Rules
|
||||
int ContextBackLayer = 10;
|
||||
int MenuBackLayer = 20;
|
||||
int MenuMainLayer = 30;
|
||||
int MenuFrontLayer = 40;
|
||||
int ContextFrontLayer = 50;
|
||||
|
||||
// DrawListApi
|
||||
void RegisterDrawList(const UI7::ID& id, DrawList::Ref v) {
|
||||
DrawListRegestry.push_back(std::make_pair(id, v));
|
||||
@ -97,8 +91,10 @@ class IO : public SmartCtor<IO> {
|
||||
vec2 DragLastPosition = 0;
|
||||
vec4 DragDestination = 0;
|
||||
Timer::Ref DragTime;
|
||||
bool DragReleased = false; ///< Drag Releaded in Box
|
||||
bool DragReleasedAW = false; ///< Drag Released Anywhere
|
||||
u64 DragLastReleased = 0;
|
||||
bool DragReleased = false; ///< Drag Releaded in Box
|
||||
bool DragReleasedAW = false; ///< Drag Released Anywhere
|
||||
bool DragDoubleRelease = false; ///< Double Click
|
||||
/** Check if an object is Dragged already */
|
||||
bool IsObjectDragged() const { return DraggedObject != 0; }
|
||||
/**
|
||||
@ -147,6 +143,13 @@ class IO : public SmartCtor<IO> {
|
||||
// and Only if still in Box
|
||||
DragReleased = Ren->InBox(Inp->TouchPosLast(), area);
|
||||
DragReleasedAW = true; // Advanced
|
||||
u64 d_rel = Sys::GetTime();
|
||||
if (d_rel - DragLastReleased < DoubleClickTime) {
|
||||
DragDoubleRelease = true;
|
||||
DragLastReleased = 0; // Set 0 to prevent double exec
|
||||
} else {
|
||||
DragLastReleased = d_rel;
|
||||
}
|
||||
// Ensure timer is paused
|
||||
DragTime->Pause();
|
||||
DragTime->Reset();
|
||||
|
@ -80,7 +80,7 @@ class Menu : public SmartCtor<Menu> {
|
||||
* @param img Texture reference of the image
|
||||
* @param size a Custom Size if needed
|
||||
*/
|
||||
void Image(Texture::Ref img, vec2 size = 0.f);
|
||||
void Image(Texture::Ref img, vec2 size = 0.f, LI::Rect uv = vec4(0));
|
||||
|
||||
/**
|
||||
* Color Edit Object that opens a popup editor if clicked
|
||||
|
@ -69,6 +69,11 @@ class Theme : public SmartCtor<Theme> {
|
||||
* @param theme Theme Reference
|
||||
*/
|
||||
static void Default(Theme& theme);
|
||||
/**
|
||||
* White Mode Theme
|
||||
* @param Theme theme reference
|
||||
*/
|
||||
static void Flashbang(Theme& theme);
|
||||
|
||||
/** Revert the last Color Change */
|
||||
Theme& Pop() {
|
||||
|
@ -37,7 +37,7 @@ SOFTWARE.
|
||||
* Major Minor Patch Build
|
||||
* 0x01010000 -> 1.1.0-0
|
||||
*/
|
||||
#define UI7_VERSION 0x00020901
|
||||
#define UI7_VERSION 0x00030000
|
||||
|
||||
namespace PD {
|
||||
namespace UI7 {
|
||||
|
Reference in New Issue
Block a user