00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "../Include/FlyLegacy.h"
00029 #include "../Include/Ui.h"
00030 #include "../Include/Utility.h"
00031 #include "../Include/Terrain.h"
00032 #include "../Include/Globals.h"
00033
00034
00035 static char *tiledetaillist[] =
00036 {
00037 "LOW",
00038 "MEDIUM",
00039 "HIGH",
00040 NULL
00041 };
00042
00043
00044 typedef struct {
00045 puDialogBox* dialog;
00046 puFrame* frame;
00047 puText* title;
00048
00049 puInput* x_input;
00050 puInput* z_input;
00051 puComboBox* detail_combo;
00052
00053 puOneShot* btnExport;
00054 puOneShot* close;
00055
00056 char et_string[80];
00057 int x;
00058 int z;
00059 } SGlobeTileTextureDialogData;
00060
00061 static SGlobeTileTextureDialogData *dt = NULL;
00062
00063
00064 static void globe_tile_texture_export_cb (puObject* obj)
00065 {
00066 if (dt == NULL) return;
00067
00068 ETileDetail detail = (ETileDetail) dt->detail_combo->getCurrentItem ();
00069
00070 if ((dt->x >= 0) && (dt->x <= 255) && (dt->z >= 0) && (dt->z <= 255)) {
00071
00072 } else {
00073 DrawNoticeToUser ("ERROR : Globe tile coordinates must be in range 0-255", 5);
00074 }
00075 }
00076
00077 static void globe_tile_texture_close_cb (puObject* obj)
00078 {
00079 if (dt == NULL) return;
00080
00081
00082 delete dt->dialog;
00083
00084
00085 delete dt;
00086 dt = NULL;
00087 }
00088
00089
00090 void globe_tile_texture_dlg_create (void)
00091 {
00092 if (dt != NULL) return;
00093
00094
00095 dt = new SGlobeTileTextureDialogData;
00096 dt->x = 0;
00097 dt->z = 0;
00098
00099
00100 int frame_w = 300;
00101 int frame_h = 200;
00102
00103
00104 dt->dialog = new puDialogBox (20, globals->screenHeight - 25 - frame_h);
00105 {
00106
00107 dt->frame = new puFrame (0, 0, frame_w, frame_h);
00108
00109 dt->title = new puText (10, 160);
00110 dt->title->setLabel ("Export Globe Tile Texture:");
00111
00112
00113 dt->detail_combo = new puComboBox (110, 100, 240, 120, tiledetaillist);
00114 dt->detail_combo->setLabel ("Detail :");
00115 dt->detail_combo->setLabelPlace (PUPLACE_CENTERED_LEFT);
00116 dt->detail_combo->setStyle (PUSTYLE_BOXED);
00117 dt->detail_combo->setCurrentItem (0);
00118
00119
00120 dt->x_input = new puInput (80, 60, 130, 80);
00121 dt->x_input->setLabel ("GT X :");
00122 dt->x_input->setLabelPlace (PUPLACE_CENTERED_LEFT);
00123 dt->x_input->setStyle (PUSTYLE_BOXED);
00124 dt->x_input->setValuator (&dt->x);
00125
00126
00127 dt->z_input = new puInput (200, 60, 250, 80);
00128 dt->z_input->setLabel ("GT Z :");
00129 dt->z_input->setLabelPlace (PUPLACE_CENTERED_LEFT);
00130 dt->z_input->setStyle (PUSTYLE_BOXED);
00131 dt->z_input->setValuator (&dt->z);
00132
00133
00134 dt->btnExport = new puOneShot (110, 20, 170, 40);
00135 dt->btnExport->setLegend ("Export");
00136 dt->btnExport->makeReturnDefault (false);
00137 dt->btnExport->setStyle (PUSTYLE_SMALL_SHADED);
00138 dt->btnExport->setCallback (globe_tile_texture_export_cb);
00139
00140
00141 dt->close = new puOneShot (190, 20, 240, 40);
00142 dt->close->setLegend ("Close");
00143 dt->close->makeReturnDefault (false);
00144 dt->close->setStyle (PUSTYLE_SMALL_SHADED);
00145 dt->close->setCallback (globe_tile_texture_close_cb);
00146 }
00147 dt->dialog->close ();
00148 dt->dialog->reveal ();
00149 }
00150