osb/source/windowing/StarGuiTypes.hpp

49 lines
915 B
C++
Raw Normal View History

#pragma once
2023-06-20 04:33:09 +00:00
#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];
}
}
}