Inform - Resources - Examples

Back to List

Inventory
Complete

Backward
Forward

Plain
Coloured
Gaudy

This code
in plain text

Browsing Museum.inf

DrawStatusLine replacing the usual library version (lines 1854-1924)

1854  Constant U_POS 28; Constant W_POS 30; Constant C_POS 31;
1855  Constant E_POS 32; Constant IN_POS 34;
1856   
1857  Array printed_text table 64;
1858   
1859  [ DrawStatusLine j posa posb width;
1860    if (location==0) rfalse;
1861    width = 0->33; if (width==0) width=80;
1862    switch(status_style)
1863    {   1: @split_window 0;
1864        2: font off;
1865           @split_window 1; @buffer_mode 0; @set_window 1;
1866           style reverse; @set_cursor 1 1; spaces width;
1867           printed_text-->0 = 64;
1868           @output_stream 3 printed_text;
1869           print (name) location;
1870           @output_stream -3;
1871           j=(width-(printed_text-->0))/2;
1872           @set_cursor 1 j; print (name) location; spaces(j-1);
1873           style roman;
1874           @buffer_mode 1; @set_window 0; font on;
1875        3: @split_window 1; @set_window 1; @set_cursor 1 1; style reverse;
1876           posa = width-26; posb = width-13;
1877           spaces width;
1878           @set_cursor 1 2; print (name) location;
1879           if (width > 76)
1880           {   @set_cursor 1 posa; print "Score: ", sline1;
1881               @set_cursor 1 posb; print "Moves: ", sline2;
1882           }
1883           if (width > 63 && width <= 76)
1884           {   @set_cursor 1 posb; print sline1, "/", sline2;
1885           }
1886           @set_cursor 1 1; style roman; @set_window 0;
1887        4: if (e_obj.door_dir~=e_to)
1888           {   @split_window 1; @set_window 1; style reverse; font off;
1889               @set_cursor; spaces width;
1890               print "You're very disoriented in this reflected world";
1891               @set_cursor 1 1; style roman; @set_window 0; font on;
1892               rfalse;
1893           }
1894           @split_window 3; @set_window 1; style reverse; font off;
1895           @set_cursor 1 1; spaces width;
1896           @set_cursor 2 1; spaces width;
1897           @set_cursor 3 1; spaces width;
1898           @set_cursor 1 2;  print (name) location;
1899           @set_cursor 1 51; print "Score: ", sline1;
1900           @set_cursor 1 64; print "Moves: ", sline2;
1901           if (location ~= thedark)
1902           {   ! First line
1903               if (location.u_to ~= 0)  { @set_cursor 1 U_POS; print "U"; }
1904               if (location.nw_to ~= 0) { @set_cursor 1 W_POS; print "@@92"; }
1905               if (location.n_to ~= 0)  { @set_cursor 1 C_POS; print "@@124"; }
1906               if (location.ne_to ~= 0) { @set_cursor 1 E_POS; print "/"; }
1907               if (location.in_to ~= 0) { @set_cursor 1 IN_POS; print "I"; }
1908               ! Second line
1909               if (location.w_to ~= 0)  { @set_cursor 2 W_POS; print "-"; }
1910                                          @set_cursor 2 C_POS; print "o";
1911               if (location.e_to ~= 0)  { @set_cursor 2 E_POS; print "-"; }
1912               ! Third line
1913               if (location.d_to ~= 0)  { @set_cursor 3 U_POS; print "D"; }
1914               if (location.sw_to ~= 0) { @set_cursor 3 W_POS; print "/"; }
1915               if (location.s_to ~= 0)  { @set_cursor 3 C_POS; print "@@124"; }
1916               if (location.se_to ~= 0) { @set_cursor 3 E_POS; print "@@92"; }
1917               if (location.out_to ~= 0){ @set_cursor 3 IN_POS; print "O"; }
1918           }
1919           @set_cursor 1 1; style roman; @set_window 0; font on;
1920    }
1921  ];
1922   
1923  ! --------------------------------------------------------------------------
1924   


Last updated 23 June 2004. This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation. Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.