Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function gumptest( npc, mobile, forsale, shopping_cart )
- var gflayout := {
- "page 0",
- "nodispose",
- "resizepic 0 0 5170 200 300",
- "text 40 40 50 0",
- "text 40 100 50 1",
- "text 40 160 50 2",
- "text 40 220 50 3",
- "button 100 40 249 248 1 0 0",
- "button 100 100 249 248 1 0 0",
- "button 100 160 249 248 1 0 0",
- "button 100 220 249 248 1 0 0"
- };
- var gfdata := {"Buy",
- "Sell",
- "Train",
- "Sell Bag"
- };
- var choice := SendDialogGump( mobile, gflayout, gfdata );
- var his_choice;
- foreach key in ( choice.keys )
- his_choice := key;
- endforeach
- var output;
- case ( his_choice )
- 100: output := "The player chose the button the value of which is 100";
- 200: output := "The player chose the button the value of which is 200";
- 300: output := "The player chose the button the value of which is 300";
- 400: output := "The player chose the button the value of which is 400";
- default: output := "The player must have canceled the gump without doing anything";
- // default means if the value is neither 1 nor any of the radio-values
- // [so the player canceled the gump without doing anything]. In this example it doesn't matter
- // whether you press the okay-button or not, the values are counted anyways. This is because
- // it is not important for this example. If you're writing a gump and want it to work correctly
- // you should embed a test if the okay-button was pressed
- // [like this: if ( choice[0] == 1 ) <- then the player has pressed the okay-button.
- // Why? You should know]
- endcase
- endfunction
Add Comment
Please, Sign In to add comment