#include <deadron/characterhandling>
#include <dantom/htmllib>
client/base_num_characters_allowed = 50
mob/BaseCamp/ChoosingCharacter
ChooseCharacterMenu(list/menu)
var/menu_rows = ""
for (var/item in menu)
menu_rows += {"<tr><td align="center"><a href="?menu=choosing_character;choice=[item];src=\ref[src]">\[[item]]</a></td></tr>"}
var/page = {"
<body bgcolor=black scroll=no>
<center>
<h2><font color="blue">Welcome to Niran's RPG!</font></h2>
<b><i>Choose a character</i></b><br><br>
<table border=1 cellpadding=3>
[menu_rows]
</table>
</center>
"}
src << browse(page, "window=CharacterMenu;titlebar=0;can_close=0;can_minimize=0;size=600x400")
DeleteCharacterMenu(list/menu)
var/menu_rows = ""
for (var/item in menu)
menu_rows += {"<tr><td align="center"><a href="?menu=deleting_character;choice=[item];src=\ref[src]">\[[item]]</a></td></tr>"}
var/page = {"
<body bgcolor=black scroll=no>
<center>
<h2><font color="blue">Deleting character!</font></h2>
<b><i>Choose who to rub out</i></b><br><br>
<table border=1 cellpadding=3>
[menu_rows]
</table>
</center>
"}
src << browse(page, "window=CharacterMenu;titlebar=0;can_close=0;can_minimize=0;size=600x400")
Topic(href, href_list[])
var/menu = href_list["menu"]
switch(menu)
if ("choosing_character")
// Close the menu window.
src << browse(null, "window=CharacterMenu")
var/choice = href_list["choice"]
ChooseCharacterResult(choice)
return
if ("deleting_character")
// Close the menu window.
src << browse(null, "window=CharacterMenu")
var/choice = href_list["choice"]
DeleteCharacterResult(choice)
return
return ..()
world/mob = /mob/creating_character
mob/creating_character
base_save_allowed = 0
var
Form/NewCharacter/char_form = new()
error_text = ""
Login()
spawn()
src.char_form.DisplayForm()
RemoveVerbs()
return
Stat()
return
proc/RemoveVerbs()
for (var/item in verbs)
verbs -= item
return
Form/NewCharacter
form_window = "window=NewCharacter;titlebar=0;can_close=0;can_minimize=0;size=600x400"
var
name
gender
gender_1 = "Male"
gender_2 = "Female"
class
class_values = list("Student")
Initialize()
if (!name) name = usr.key
if (!gender) gender = "Male"
if (!class) class = "Student"
usr << browse_rsc('niransgame.bmp', "niransgame.bmp")
HtmlLayout()
var/mob/creating_character/player = usr
var/page = {"<body bgcolor=black>
<center><img src="niransgame.bmp"></center>
<font color=red><b>[player.error_text]</b></font><br>
<table>
<tr><td><b>Name:</b></td><td>[name]</td></tr>
<tr><td> </td><td> </td></tr>
<tr><td><b>Gender:</b></td>
<td>
[gender_1] <font color=Male<br>
[gender_2] Female
</td>
<tr><td> </td><td> </td></tr>
<tr><td><b>Class:</b></td><td>[class]</td>
<tr><td> </td><td> </td></tr>
<tr><td> </td><td>[submit]</td></tr>
</table>
"}
return page
ProcessForm()
var/mob/creating_character/player = usr
var/ckey_name = ckey(name)
if (!ckey_name || ckey_name == "")
player.error_text = "Your name must have alpha-numeric characters in it!"
DisplayForm()
return
var/mob/new_mob
switch(class)
if ("Student") new_mob = new /mob/Characters/Student()
switch(gender)
if ("Male")
new_mob.gender = MALE
new_mob.icon = 'male-student.dmi'
if ("Female")
new_mob.gender = FEMALE
new_mob.icon = 'female-student.dmi'
new_mob.name = name
usr.client.mob = new_mob
new_mob << browse(null, "window=NewCharacter") //removes the screen.
return
mob
Login()
..()
sample_report()
proc
sample_report()
src << "<BR><BR>"
src << "\blue You are a [gender] [name]."
src << "\blue Your class is [type]."
Problem description:
Whenever I choose [Delete Character] it logs me out...