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 typedef struct {
00035 puDialogBox* dialog;
00036 puFrame* frame;
00037 puText* title;
00038
00039 puInput* et_input;
00040
00041 puOneShot* btnExport;
00042 puOneShot* close;
00043
00044 char et_string[80];
00045 } SElevationTileDialogData;
00046
00047 static SElevationTileDialogData *dt = NULL;
00048
00049
00050 static void elevation_tile_texture_export_cb (puObject* obj)
00051 {
00052 if (dt == NULL) return;
00053
00054 int et;
00055 if (sscanf (dt->et_string, "%x", &et) == 1) {
00056
00057 } else {
00058 DrawNoticeToUser ("ERROR : Elevation Tile must be hex value 000-3FF", 5);
00059 }
00060 }
00061
00062 static void elevation_tile_texture_close_cb (puObject* obj)
00063 {
00064 if (dt == NULL) return;
00065
00066
00067 delete dt->dialog;
00068
00069
00070 delete dt;
00071 dt = NULL;
00072 }
00073
00074
00075 void elevation_tile_texture_dlg_create (void)
00076 {
00077 if (dt != NULL) return;
00078
00079
00080 dt = new SElevationTileDialogData;
00081 strcpy (dt->et_string, "");
00082
00083
00084 int frame_w = 300;
00085 int frame_h = 150;
00086
00087
00088 dt->dialog = new puDialogBox (20, globals->screenHeight - 25 - frame_h);
00089 {
00090
00091 dt->frame = new puFrame (0, 0, frame_w, frame_h);
00092
00093 dt->title = new puText (10, 100);
00094 dt->title->setLabel ("Export Elevation Tile Texture:");
00095
00096
00097 dt->et_input = new puInput (220, 60, 260, 80);
00098 dt->et_input->setLabel ("ET (000 - 3FF) :");
00099 dt->et_input->setLabelPlace (PUPLACE_CENTERED_LEFT);
00100 dt->et_input->setStyle (PUSTYLE_BOXED);
00101 dt->et_input->setValuator (dt->et_string);
00102
00103
00104 dt->btnExport = new puOneShot (110, 20, 170, 40);
00105 dt->btnExport->setLegend ("Export");
00106 dt->btnExport->makeReturnDefault (false);
00107 dt->btnExport->setStyle (PUSTYLE_SMALL_SHADED);
00108 dt->btnExport->setCallback (elevation_tile_texture_export_cb);
00109
00110
00111 dt->close = new puOneShot (190, 20, 240, 40);
00112 dt->close->setLegend ("Close");
00113 dt->close->makeReturnDefault (false);
00114 dt->close->setStyle (PUSTYLE_SMALL_SHADED);
00115 dt->close->setCallback (elevation_tile_texture_close_cb);
00116 }
00117 dt->dialog->close ();
00118 dt->dialog->reveal ();
00119 }
00120