NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#pragma once

#ifndef Tactical_ship_window_gwen_gui_h__
#define Tactical_ship_window_gwen_gui_h__

#ifdef USE_GWEN_UI

#include "Base_window_gwen_ui.h"
#include "Tactical_ship_window_ui.h"

class Tactical_ship_window;
class Craft_definition;

class Tactical_window_gwen_ui : public Base_window_gwen_ui, public Tactical_window_ui
{

private:
Tactical_ship_window* event_target;

Gwen::Point canvas_size;

Gwen::Controls::ImageLabel main_frame;
Gwen::Controls::ImageLabel repair_frame;
Gwen::Controls::ProgressBar progress_bar_repairing;
Gwen::Controls::Label label_cost;
Gwen::Controls::Label label_credit;
Gwen::Controls::Label label_buy_fuel;
Gwen::Controls::Label label_buy_ammo;
Gwen::Controls::Label label_buy_repairkit;
Gwen::Controls::Button button_buy_fuel;
Gwen::Controls::Button button_buy_ammo;
Gwen::Controls::Button button_buy_repairkit;
Gwen::Controls::ImageLabel hud;
Gwen::Controls::CheckBoxWithLabel checkbox_with_label_ready;
Gwen::Controls::Label label_speedometer;
Gwen::Controls::Label craft_info_label;
Gwen::Controls::Label consumable_label;
Gwen::Controls::TextBoxMultiline textbox_chat;

Gwen::Controls::ImageButton* craft_buttons[MAX_SHIP_COUNT_IN_HANGAR_SLOT];


int hud_mode;
void on_enter_buy_fuel_button_clicked(Gwen::Controls::Base *button);
void on_enter_buy_ammo_button_clicked(Gwen::Controls::Base *button);
void on_enter_buy_repairkit_button_clicked(Gwen::Controls::Base *button);

void on_enter_repaired_and_ready();
void on_select_craft(Gwen::Event::Info& info);

public:
Tactical_window_gwen_ui( Tactical_ship_window* event_target );
~Tactical_window_gwen_ui();

virtual void set_inventory(const vector<inventory_item_content>& inventory_contents);

void set_label_text_percentage(const int total_repair_percentage);
void set_label_text_credit(const int msg);
void set_label_text_cost(const int cost, const int total_repair_cost);

void set_buy_fuel_interface(const int fuel, const int fuel_buy_cost);
void set_buy_ammo_interface(const int ammo, const int ammo_buy_cost);
void set_buy_repairkit_interface(const int repair_kit, const int repair_kit_buy_cost);
const char *get_info_label_text();
void update_progress_bar(float value);
void set_hangar_ship_buttons(const vector<Craft_definition*>& craft_definitions); // a hangar can contain more than 1 craft in battle mode
void disable_craft_button(int craft_index);


void show_repair_frame()
{
repair_frame.Show();
}
void hide_repair_frame()
{
repair_frame.Hide();
}

bool is_repair_frame_visible() const
{
return repair_frame.Visible();
}

bool is_chat_window_visible() const
{
return textbox_chat.Visible();
}

void show_chatbox()
{
textbox_chat.Show();
textbox_chat.Focus();
textbox_chat.SetText("");
}

void set_speed_in_kmph(int speed_in_kmph)
{
rglVarString speed_text = "";
speed_text.append(speed_in_kmph);
speed_text.append(" km/h");
if(strcmp(speed_text.char_p(), label_speedometer.GetText().c_str()))
{
label_speedometer.SetText(speed_text.char_p());
}
}

void select_next_hud_mode();


bool textbox_chat_has_text()
{
return textbox_chat.TextLength()>0;
}
rglVarString textbox_chat_get_text()
{
return rglVarString(textbox_chat.GetText().c_str());
}

void textbox_chat_set_text(const rglVarString& text)
{
textbox_chat.SetText(text.char_p());
}

void textbox_chat_hide()
{
textbox_chat.Hide();
}
void textbox_chat_show()
{
textbox_chat.Show();
}

void set_remaining_consumable_info(const Consumable_info& consumable_info)
{
const int buffer_len = 2048;
char buffer[buffer_len];
rgl_snprintf(buffer, buffer_len, "Fuel: %.2fnAmmo: %dnMissile: %dnRepair Kit: %d", consumable_info.fuel, consumable_info.ammo, consumable_info.missile_count, consumable_info.repair_kit_count);
if(strcmp(consumable_label.GetText().c_str(), buffer))
{
consumable_label.SetText(buffer);
consumable_label.SizeToContents();
}
}

void set_craft_stat_info(const Craft_stat_info& craft_stat_info)
{
const int buffer_len = 2048;
char buffer[buffer_len];

float total_cargo_usage = craft_stat_info.cargo_usage_by_installed_parts + craft_stat_info.cargo_usage_by_inventory_items;

rgl_snprintf(buffer, buffer_len, "Health: %.1fnUpgrade Credits: %dnLife Cube: %dnPart Count: %d/%d(min:%d)nCargo Usage:%.2f(%.2f+%.2f)/%.2fnMass: %dn",
craft_stat_info.health,
craft_stat_info.upgrade_credits,
craft_stat_info.life_support_unit_count,
craft_stat_info.working_part_count,
craft_stat_info.total_part_count,
craft_stat_info.min_part_count_for_survival,
total_cargo_usage,
craft_stat_info.cargo_usage_by_installed_parts,
craft_stat_info.cargo_usage_by_inventory_items,
craft_stat_info.cargo_capacity,
(int)craft_stat_info.mass);
if(strcmp(buffer, craft_info_label.GetText().c_str()))
{
craft_info_label.SetText(buffer);
craft_info_label.SizeToContents();
}
}

//confirmation dialog box
void show_confirmation_dialog(const rglVarString& label_text, Yes_no_prompt_handler *prompt_action_handler)
{
show_yes_no_prompt(label_text, prompt_action_handler);
}
void hide_confirmation_dialog()
{
hide_yes_no_prompt();
}
bool is_confirmation_dialog_visible()
{
return is_yes_no_prompt_visible();
}

//inventory
bool is_mouse_on_inventory()
{
return mouse_is_on_inventory();
}
void show_inventory()
{
show_inventory_();
}
void hide_inventory()
{
hide_inventory_();
}
void deselect_inventory()
{
deselect_inventory_item_();
}
bool is_inventory_item_selected()
{
return inventory_item_selected_();
}
int get_selected_inventory_part_instance()
{
return get_selected_inventory_part_instance_();
}
void set_stats_tooltip_text(const rglVarString& stats_text)
{
set_stats_tooltip_text_(stats_text);
}

};


#endif //USE_GWEN_UI

#endif // Tactical_ship_window_gwen_gui_h__
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.