Single-Line Window

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

Merk
Posts: 192
Joined: Mon Nov 22, 2004 3:19 pm
Location: Wichita, KS
Contact:

Single-Line Window

Post by Merk »

Because of the layout of my new game, I needed to mess around with the status line. It'll go all the way across the top, like normal, without graphics. But with graphics, I wanted it to appear at the top of the "status" area (I grabbed the window defs from Guilty Bastards and modified them), with the graphic going to the top (status line doesn't stretch above it). In order to do this, I can't just use a "window 1" command (that would make it go all the way across the top). I could do a custom "window" command, but I was trying to get the window_class to work.

What I found was odd. If I tried a 1-line window, it would always give me a 10-line window instead. I could do a 2-line window, but nothing shorter.

I found the problem in window.h, and modified a duplicate copy for my purpose. But, I thought I'd shared this. I don't know if it intentionally doesn't support a 1-line window, but here's what I did to change it:

Code: Select all

height = self.win_bottom - self.win_top
!!!MPS 06/01/2005 - increment first, to support 1-line windows.
!if height++ = 0:  height = 10
if ++height <= 0&#58;  height = 10
if self.win_title&#58;  height++

Merk
Posts: 192
Joined: Mon Nov 22, 2004 3:19 pm
Location: Wichita, KS
Contact:

Post by Merk »

By the way, that code replaces the block that starts at line 97 in window.h.

Post Reply