Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2013-11-12 21:09:30 +0000
committerStijn Buys <ingar@osirion.org>2013-11-12 21:09:30 +0000
commitf192b3019662e9ca6805992ba5e879e5b50b0958 (patch)
tree06b67d800eabfeb588c170017e1f6019487cd8de /src/client
parentad8f2fe096b2bca7294f07635675f30b94b2977a (diff)
Support for player autopilot terget next to mission target,
bumped network protocol version to 28, disable freeflight button if there is no autopilot target.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/gamewindow.cc5
-rw-r--r--src/client/hud.cc27
-rw-r--r--src/client/targets.cc2
3 files changed, 28 insertions, 6 deletions
diff --git a/src/client/gamewindow.cc b/src/client/gamewindow.cc
index 71a2171..0b39cea 100644
--- a/src/client/gamewindow.cc
+++ b/src/client/gamewindow.cc
@@ -402,6 +402,11 @@ void GameWindow::draw()
gamewindow_launchbutton->hide();
gamewindow_freeflightbutton->show();
+ if (core::localplayer()->autopilot_target()) {
+ gamewindow_freeflightbutton->enable();
+ } else {
+ gamewindow_freeflightbutton->disable();
+ }
gamewindow_gotobutton->show();
gamewindow_dockbutton->show();
gamewindow_formationbutton->show();
diff --git a/src/client/hud.cc b/src/client/hud.cc
index 1fabe10..4c98bd8 100644
--- a/src/client/hud.cc
+++ b/src/client/hud.cc
@@ -171,6 +171,8 @@ void HUD::draw_offscreen_target(core::Entity *entity, bool is_active_target)
if (entity == core::localplayer()->mission_target()) {
bitmap_color.assign(palette()->mission());
+ } else if (entity == core::localplayer()->autopilot_target()) {
+ bitmap_color.assign(palette()->mission());
}
render::Textures::bind(bitmap_material.c_str());
@@ -252,6 +254,7 @@ void HUD::draw_target(core::Entity *entity, bool is_active_target)
std:: string bitmap_material;
+ // default target color
if (controlable) {
if (controlable->owner()) {
bitmap_material.assign("bitmaps/hud/target_controlable");
@@ -262,25 +265,33 @@ void HUD::draw_target(core::Entity *entity, bool is_active_target)
} else if (entity->has_flag(core::Entity::Dockable)) {
bitmap_material.assign("bitmaps/hud/target_dockable");
-
bitmap_color.assign(1.0f, 1.0f, 1.0f); // white
+
} else {
bitmap_material.assign("bitmaps/hud/target_default");
bitmap_color.assign(palette()->text()); // default text color
+
}
- // reputation color
- if (reputation >= core::range::reputation_friendly) {
+ // mission, autopilot and reputation override target color
+ if (entity == core::localplayer()->mission_target()) {
+ // mission target
+ bitmap_color.assign(palette()->mission());
+
+ } else if (entity == core::localplayer()->autopilot_target()) {
+ // mission target
+ bitmap_color.assign(palette()->mission());
+
+ } else if (reputation >= core::range::reputation_friendly) {
// friendly
bitmap_color.assign(0.0f, 1.0f, 0.0f); // green
+
} else if (reputation <= core::range::reputation_hostile) {
// hostile
bitmap_color.assign(1.0f, 0.0f, 0.0f); // red
+
}
- if (entity == core::localplayer()->mission_target()) {
- bitmap_color.assign(palette()->mission());
- }
ui::Paint::draw_bitmap(bitmap_location, bitmap_size, bitmap_color, bitmap_material);
// ---------------------------------------------------------
@@ -443,6 +454,10 @@ void HUD::draw()
// draw current HUD target
draw_target(entity, true);
+ } else if (entity == core::localplayer()->autopilot_target()) {
+ // draw current mission target
+ draw_target(entity, false);
+
} else if (entity == core::localplayer()->mission_target()) {
// draw current mission target
draw_target(entity, false);
diff --git a/src/client/targets.cc b/src/client/targets.cc
index 088d334..466b4a9 100644
--- a/src/client/targets.cc
+++ b/src/client/targets.cc
@@ -68,6 +68,8 @@ bool is_valid_hud_target(const core::Entity *entity)
return true;
} else if (entity == core::localplayer()->mission_target()) {
return true;
+ } else if (entity == core::localplayer()->autopilot_target()) {
+ return true;
} else if (!ext_render(entity)) {
return false;
} else {