editor: highlighting the current mode
This commit is contained in:
+12
-11
@@ -410,8 +410,10 @@ void View::DrawUi () {
|
||||
|
||||
ViewState current_view_state = GetViewState();
|
||||
|
||||
/*
|
||||
SelectFont ("console.ttf size=12");
|
||||
Engine::GUI::Label (99999, GetStringViewState(current_view_state), 8, 16);
|
||||
*/
|
||||
|
||||
switch (current_view_state) {
|
||||
case ViewStateMainMenu:
|
||||
@@ -673,7 +675,6 @@ void View::DrawUiHighscore() {
|
||||
DrawPageTitle ("Highscores");
|
||||
SelectFont ("console.ttf size=23");
|
||||
|
||||
|
||||
unsigned int entry_length = 32;
|
||||
float char_width, height;
|
||||
DrawGLStringMeasure ("M", &char_width, &height);
|
||||
@@ -785,25 +786,25 @@ void View::DrawUiEditor() {
|
||||
}
|
||||
|
||||
if (mEditorState != EditorStateTest) {
|
||||
if (Engine::GUI::Button (2, "Add", 30, 20, 50, button_height)) {
|
||||
if (Engine::GUI::CheckButton (2, "Add", mEditorState == EditorStateAddEntity, 30, 20, 50, button_height)) {
|
||||
mEditorState = EditorStateAddEntity;
|
||||
Engine::LogDebug ("Editor state now Add");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Engine::GUI::Button (3, "Del", 85, 20, 50, button_height)) {
|
||||
if (Engine::GUI::CheckButton (3, "Del", mEditorState == EditorStateDelEntity, 85, 20, 50, button_height)) {
|
||||
mEditorState = EditorStateDelEntity;
|
||||
Engine::LogDebug ("Editor state now Del");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Engine::GUI::Button (4, "Move", 140, 20, 65, button_height)) {
|
||||
if (Engine::GUI::CheckButton (4, "Move", mEditorState == EditorStateMoveEntity, 140, 20, 65, button_height)) {
|
||||
mEditorState = EditorStateMoveEntity;
|
||||
Engine::LogDebug ("Editor state now Move");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Engine::GUI::Button (5, "Spd", 210, 20, 50, button_height)) {
|
||||
if (Engine::GUI::CheckButton (5, "Spd", mEditorState == EditorStateEntityVelocity, 210, 20, 50, button_height)) {
|
||||
mEditorState = EditorStateEntityVelocity;
|
||||
Engine::LogDebug ("Editor state now Add");
|
||||
return;
|
||||
@@ -843,7 +844,7 @@ void View::DrawUiEditor() {
|
||||
|
||||
if (mEditorState == EditorStateAddEntity) {
|
||||
SelectFont ("console.ttf size=12");
|
||||
Engine::GUI::Label (9999, "Adding", 128, 16);
|
||||
// Engine::GUI::Label (9999, "Adding", 128, 16);
|
||||
|
||||
if (Engine::GUI::CheckKeyPressed(MouseButtonLeft)) {
|
||||
// if there is no entity so far we create a player, otherwise we create
|
||||
@@ -866,7 +867,7 @@ void View::DrawUiEditor() {
|
||||
|
||||
if (mEditorState == EditorStateDelEntity) {
|
||||
SelectFont ("console.ttf size=12");
|
||||
Engine::GUI::Label (9999, "Deleting", 128, 16);
|
||||
// Engine::GUI::Label (9999, "Deleting", 128, 16);
|
||||
|
||||
if (Engine::GUI::CheckKeyPressed(MouseButtonLeft)) {
|
||||
// Check if there is an entity near the given position
|
||||
@@ -881,7 +882,7 @@ void View::DrawUiEditor() {
|
||||
|
||||
if (mEditorState == EditorStateMoveEntity) {
|
||||
SelectFont ("console.ttf size=12");
|
||||
Engine::GUI::Label (9999, "Moving", 128, 16);
|
||||
// Engine::GUI::Label (9999, "Moving", 128, 16);
|
||||
|
||||
if (Engine::GUI::CheckKeyPress(MouseButtonLeft)) {
|
||||
// Check if there is an entity near the given position
|
||||
@@ -905,7 +906,7 @@ void View::DrawUiEditor() {
|
||||
|
||||
if (mEditorState == EditorStateEntityVelocity) {
|
||||
SelectFont ("console.ttf size=12");
|
||||
Engine::GUI::Label (9999, "Velocity", 128, 16);
|
||||
// Engine::GUI::Label (9999, "Velocity", 128, 16);
|
||||
|
||||
if (mEditorEntityId == 0) {
|
||||
if (Engine::GUI::CheckKeyPress(MouseButtonLeft)) {
|
||||
@@ -935,7 +936,7 @@ void View::DrawUiEditor() {
|
||||
if (mEditorState == EditorStateSave) {
|
||||
glColor3f (0.2, 0.2, 0.2);
|
||||
Engine::GUI::DrawRoundedBlock (140, 150, screen_right - 280, 200);
|
||||
Engine::GUI::Label (9999, "Saving", 128, 16);
|
||||
// Engine::GUI::Label (9999, "Saving", 128, 16);
|
||||
SelectFont ("console.ttf size=23");
|
||||
|
||||
Engine::GUI::Label(51, "Filename: ", 145, 180);
|
||||
@@ -958,7 +959,7 @@ void View::DrawUiEditor() {
|
||||
if (mEditorState == EditorStateLoad) {
|
||||
glColor3f (0.2, 0.2, 0.2);
|
||||
Engine::GUI::DrawRoundedBlock (140, 150, screen_right - 280, 200);
|
||||
Engine::GUI::Label (9999, "Loading", 128, 16);
|
||||
// Engine::GUI::Label (9999, "Loading", 128, 16);
|
||||
SelectFont ("console.ttf size=23");
|
||||
|
||||
Engine::GUI::Label(51, "Filename: ", 145, 180);
|
||||
|
||||
Reference in New Issue
Block a user