v1.4.4
This commit is contained in:
commit
9c94d113d3
10260 changed files with 1237388 additions and 0 deletions
51
source/windowing/StarGuiTypes.hpp
Normal file
51
source/windowing/StarGuiTypes.hpp
Normal file
|
@ -0,0 +1,51 @@
|
|||
#ifndef STAR_WIDGET_UTILITIES_HPP
|
||||
#define STAR_WIDGET_UTILITIES_HPP
|
||||
|
||||
#include "StarString.hpp"
|
||||
#include "StarVector.hpp"
|
||||
#include "StarBiMap.hpp"
|
||||
#include "StarGameTypes.hpp"
|
||||
|
||||
namespace Star {
|
||||
|
||||
struct ImageStretchSet {
|
||||
// how does inner fill up space?
|
||||
enum class ImageStretchType {
|
||||
Stretch,
|
||||
Repeat
|
||||
};
|
||||
|
||||
String begin;
|
||||
String inner;
|
||||
String end;
|
||||
ImageStretchType type;
|
||||
|
||||
bool fullyPopulated() const;
|
||||
};
|
||||
|
||||
enum class GuiDirection {
|
||||
Horizontal,
|
||||
Vertical
|
||||
};
|
||||
extern EnumMap<GuiDirection> const GuiDirectionNames;
|
||||
|
||||
GuiDirection otherDirection(GuiDirection direction);
|
||||
|
||||
template <typename T>
|
||||
T directionalValueFromVector(GuiDirection direction, Vector<T, 2> const& vec);
|
||||
|
||||
String rarityBorder(Rarity rarity);
|
||||
|
||||
template <typename T>
|
||||
T& directionalValueFromVector(GuiDirection direction, Vector<T, 2> const& vec) {
|
||||
switch (direction) {
|
||||
case GuiDirection::Horizontal:
|
||||
return vec[0];
|
||||
case GuiDirection::Vertical:
|
||||
return vec[1];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue