added settings menu to PCMenus, use correct font for PCMenus.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@535 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
+2
-1
@@ -1,7 +1,8 @@
|
|||||||
Changes towards version 0.2:
|
Changes towards version 0.2:
|
||||||
|
- PCMenus now suports 'settings', and menu font is correct -PhracturedBlue
|
||||||
- Added '-b' option to get PC Menus -PhracturedBlue
|
- Added '-b' option to get PC Menus -PhracturedBlue
|
||||||
- Check for a deadlock in savedgames and try to continue -PhracturedBlue
|
- Check for a deadlock in savedgames and try to continue -PhracturedBlue
|
||||||
- Added an option ('-a') to display 'PC-style' course-scan -PhracturedBlue
|
- Added an option ('-a') to display 'PC-style' coarse-scan -PhracturedBlue
|
||||||
- Fixed deadlock races in new FlushGraphics method -PhracturedBlue
|
- Fixed deadlock races in new FlushGraphics method -PhracturedBlue
|
||||||
- FlushGraphics now waits and notifies on a per-thread level
|
- FlushGraphics now waits and notifies on a per-thread level
|
||||||
- No longer using SHGetFolderPath on Windows - SvdB
|
- No longer using SHGetFolderPath on Windows - SvdB
|
||||||
|
|||||||
@@ -87,8 +87,6 @@ Implementation bugs (low priority):
|
|||||||
to disappear sometimes. The scaling should be made trilinear instead of
|
to disappear sometimes. The scaling should be made trilinear instead of
|
||||||
nearest neighbor.
|
nearest neighbor.
|
||||||
- PC Menu still has some issues
|
- PC Menu still has some issues
|
||||||
- 3DO menu is still used for selecting game options
|
|
||||||
- Menu Font is wrong (the PC font doesn't appear to exist in UQM)
|
|
||||||
- Still using 3DO menu hierarchy, so menu text isn't identical to PC
|
- Still using 3DO menu hierarchy, so menu text isn't identical to PC
|
||||||
Stuff still to do (large):
|
Stuff still to do (large):
|
||||||
- add some way to configure your keys
|
- add some way to configure your keys
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "starcon.h"
|
#include "starcon.h"
|
||||||
#include "commglue.h"
|
#include "commglue.h"
|
||||||
|
#include "options.h"
|
||||||
#include "libs/graphics/gfx_common.h"
|
#include "libs/graphics/gfx_common.h"
|
||||||
|
|
||||||
//Added by Chris
|
//Added by Chris
|
||||||
@@ -104,6 +105,7 @@ static void
|
|||||||
FeedbackSetting (BYTE which_setting)
|
FeedbackSetting (BYTE which_setting)
|
||||||
{
|
{
|
||||||
UNICODE buf[20];
|
UNICODE buf[20];
|
||||||
|
char tmpstr[3];
|
||||||
|
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
switch (which_setting)
|
switch (which_setting)
|
||||||
@@ -126,10 +128,20 @@ FeedbackSetting (BYTE which_setting)
|
|||||||
case CYBORG_NORMAL_SETTING:
|
case CYBORG_NORMAL_SETTING:
|
||||||
case CYBORG_DOUBLE_SETTING:
|
case CYBORG_DOUBLE_SETTING:
|
||||||
case CYBORG_SUPER_SETTING:
|
case CYBORG_SUPER_SETTING:
|
||||||
wsprintf (buf, "%s %s",
|
if (optPCmenu && which_setting > CYBORG_NORMAL_SETTING)
|
||||||
|
{
|
||||||
|
if (which_setting == CYBORG_DOUBLE_SETTING)
|
||||||
|
strcpy (tmpstr, "+");
|
||||||
|
else
|
||||||
|
strcpy (tmpstr, "++");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
tmpstr[0] = 0;
|
||||||
|
wsprintf (buf, "%s %s%s",
|
||||||
GAME_STRING (OPTION_STRING_BASE + 2),
|
GAME_STRING (OPTION_STRING_BASE + 2),
|
||||||
!(GLOBAL (glob_flags) & CYBORG_ENABLED)
|
!(GLOBAL (glob_flags) & CYBORG_ENABLED)
|
||||||
? GAME_STRING (OPTION_STRING_BASE + 3) : GAME_STRING (OPTION_STRING_BASE + 4));
|
? GAME_STRING (OPTION_STRING_BASE + 3) : GAME_STRING (OPTION_STRING_BASE + 4),
|
||||||
|
tmpstr);
|
||||||
break;
|
break;
|
||||||
case CHANGE_CAPTAIN_SETTING:
|
case CHANGE_CAPTAIN_SETTING:
|
||||||
case CHANGE_SHIP_SETTING:
|
case CHANGE_SHIP_SETTING:
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ PrintCoarseScanPC (void)
|
|||||||
if (temp >= 10 * 100)
|
if (temp >= 10 * 100)
|
||||||
wsprintf (buf, "%u.%u a.u.", temp / 100, (temp / 10) % 10);
|
wsprintf (buf, "%u.%u a.u.", temp / 100, (temp / 10) % 10);
|
||||||
else
|
else
|
||||||
wsprintf (buf, "%u.%02u a.u", temp / 100, temp % 100);
|
wsprintf (buf, "%u.%02u a.u.", temp / 100, temp % 100);
|
||||||
t.CharCount = (COUNT)~0;
|
t.CharCount = (COUNT)~0;
|
||||||
DrawText (&t);
|
DrawText (&t);
|
||||||
t.baseline.y += SCAN_LEADING_PC;
|
t.baseline.y += SCAN_LEADING_PC;
|
||||||
@@ -267,9 +267,9 @@ PrintCoarseScanPC (void)
|
|||||||
/ (DWORD)(100L * 100L)) == 0)
|
/ (DWORD)(100L * 100L)) == 0)
|
||||||
tr = 1;
|
tr = 1;
|
||||||
if (tr >= 10 * 100)
|
if (tr >= 10 * 100)
|
||||||
wsprintf (buf, "%lu.%lu e.s", tr / 100, (tr / 10) % 10);
|
wsprintf (buf, "%lu.%lu e.s.", tr / 100, (tr / 10) % 10);
|
||||||
else
|
else
|
||||||
wsprintf (buf, "%lu.%02lu e.s", tr / 100, tr % 100);
|
wsprintf (buf, "%lu.%02lu e.s.", tr / 100, tr % 100);
|
||||||
}
|
}
|
||||||
t.CharCount = (COUNT)~0;
|
t.CharCount = (COUNT)~0;
|
||||||
DrawText (&t);
|
DrawText (&t);
|
||||||
@@ -282,7 +282,7 @@ PrintCoarseScanPC (void)
|
|||||||
if ((temp = pSolarSysState->SysInfo.PlanetInfo.PlanetRadius) >= 10 * 100)
|
if ((temp = pSolarSysState->SysInfo.PlanetInfo.PlanetRadius) >= 10 * 100)
|
||||||
wsprintf (buf, "%u.%u e.s.", temp / 100, (temp / 10) % 10);
|
wsprintf (buf, "%u.%u e.s.", temp / 100, (temp / 10) % 10);
|
||||||
else
|
else
|
||||||
wsprintf (buf, "%u.%02u e.s", temp / 100, temp % 100);
|
wsprintf (buf, "%u.%02u e.s.", temp / 100, temp % 100);
|
||||||
t.CharCount = (COUNT)~0;
|
t.CharCount = (COUNT)~0;
|
||||||
DrawText (&t);
|
DrawText (&t);
|
||||||
t.baseline.y += SCAN_LEADING_PC;
|
t.baseline.y += SCAN_LEADING_PC;
|
||||||
|
|||||||
+79
-35
@@ -1111,38 +1111,45 @@ DrawPCMenuFrame (RECT *r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char menu_string[][11] = {
|
static char menu_string[][11] = {
|
||||||
"SCAN",
|
"scan",
|
||||||
"STARMAP",
|
"starmap",
|
||||||
"DEVICES",
|
"devices",
|
||||||
"CARGO",
|
"cargo",
|
||||||
"ROSTER",
|
"roster",
|
||||||
"GAME",
|
"game",
|
||||||
"NAVIGATE",
|
"navigate",
|
||||||
|
|
||||||
"MINERAL",
|
"mineral",
|
||||||
"ENERGY",
|
"energy",
|
||||||
"BIOLOGICAL",
|
"biological",
|
||||||
"EXIT MENU",
|
"exit menu",
|
||||||
"AUTO SCAN",
|
"autoscan",
|
||||||
"DISPATCH",
|
"dispatch",
|
||||||
|
|
||||||
"SAVE GAME",
|
"save game",
|
||||||
"LOAD GAME",
|
"load game",
|
||||||
"SETTINGS",
|
"settings",
|
||||||
"EXIT MENU",
|
"exit menu",
|
||||||
|
|
||||||
"CONVERSE",
|
"converse",
|
||||||
"ATTACK!",
|
"attack!",
|
||||||
"GAME",
|
"game",
|
||||||
|
|
||||||
"FUEL",
|
"fuel",
|
||||||
"MODULE",
|
"module",
|
||||||
"GAME",
|
"game",
|
||||||
"EXIT MENU",
|
"exit menu",
|
||||||
|
|
||||||
"CREW",
|
"crew",
|
||||||
"GAME",
|
"game",
|
||||||
"EXIT MENU",
|
"exit menu",
|
||||||
|
|
||||||
|
"sound",
|
||||||
|
"music",
|
||||||
|
"cyborg",
|
||||||
|
"captain",
|
||||||
|
"ship",
|
||||||
|
"exit menu"
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1151,24 +1158,24 @@ DrawPCMenu (BYTE beg_index, BYTE end_index, BYTE NewState, BYTE hilite, RECT *r)
|
|||||||
#define PC_MENU_HEIGHT 8
|
#define PC_MENU_HEIGHT 8
|
||||||
BYTE pos;
|
BYTE pos;
|
||||||
COUNT i;
|
COUNT i;
|
||||||
int num_items, offset;
|
int num_items;
|
||||||
FONT OldFont;
|
FONT OldFont;
|
||||||
TEXT t;
|
TEXT t;
|
||||||
UNICODE buf[40];
|
UNICODE buf[40];
|
||||||
pos = beg_index + NewState;
|
pos = beg_index + NewState;
|
||||||
num_items = 1 + end_index - beg_index;
|
num_items = 1 + end_index - beg_index;
|
||||||
|
r->corner.x -= 1;
|
||||||
|
r->extent.width += 1;
|
||||||
DrawFilledRectangle (r);
|
DrawFilledRectangle (r);
|
||||||
r->corner.x += 1;
|
|
||||||
r->extent.width -= 1;
|
|
||||||
if (num_items * PC_MENU_HEIGHT > r->extent.height)
|
if (num_items * PC_MENU_HEIGHT > r->extent.height)
|
||||||
fprintf (stderr, "Warning, no room for all menu items!\n");
|
fprintf (stderr, "Warning, no room for all menu items!\n");
|
||||||
else
|
else
|
||||||
r->corner.y += (r->extent.height - num_items * PC_MENU_HEIGHT) / 2;
|
r->corner.y += (r->extent.height - num_items * PC_MENU_HEIGHT) / 2;
|
||||||
r->extent.height = num_items * PC_MENU_HEIGHT + 4;
|
r->extent.height = num_items * PC_MENU_HEIGHT + 4;
|
||||||
DrawPCMenuFrame (r);
|
DrawPCMenuFrame (r);
|
||||||
OldFont = SetContextFont (TinyFont);
|
OldFont = SetContextFont (StarConFont);
|
||||||
t.align = ALIGN_LEFT;
|
t.align = ALIGN_LEFT;
|
||||||
t.baseline.x = r->corner.x + 3;
|
t.baseline.x = r->corner.x + 2;
|
||||||
t.baseline.y = r->corner.y + PC_MENU_HEIGHT -1;
|
t.baseline.y = r->corner.y + PC_MENU_HEIGHT -1;
|
||||||
t.pStr = buf;
|
t.pStr = buf;
|
||||||
t.CharCount = (COUNT)~0;
|
t.CharCount = (COUNT)~0;
|
||||||
@@ -1252,18 +1259,55 @@ DrawMenuStateStrings (BYTE beg_index, SWORD NewState)
|
|||||||
r.extent.width = RADAR_WIDTH + 2;
|
r.extent.width = RADAR_WIDTH + 2;
|
||||||
BatchGraphics ();
|
BatchGraphics ();
|
||||||
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xA, 0xA, 0xA), 0x08));
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xA, 0xA, 0xA), 0x08));
|
||||||
if (s.frame && optPCmenu && beg_index != PM_SOUND_ON)
|
if (s.frame && optPCmenu)
|
||||||
{
|
{
|
||||||
if (beg_index == PM_CREW)
|
if (beg_index == PM_CREW)
|
||||||
sprintf (menu_string[PM_CREW], "CREW(%d)", GLOBAL (CrewCost));
|
sprintf (menu_string[PM_CREW], "crew(%d)", GLOBAL (CrewCost));
|
||||||
if (beg_index == PM_FUEL)
|
if (beg_index == PM_FUEL)
|
||||||
sprintf (menu_string[PM_FUEL], "FUEL(%d)", GLOBAL (FuelCost));
|
sprintf (menu_string[PM_FUEL], "fuel(%d)", GLOBAL (FuelCost));
|
||||||
|
if (beg_index == PM_SOUND_ON)
|
||||||
|
{
|
||||||
|
end_index = beg_index + 5;
|
||||||
|
switch (beg_index + NewState)
|
||||||
|
{
|
||||||
|
case PM_SOUND_ON:
|
||||||
|
case PM_SOUND_OFF:
|
||||||
|
NewState = 0;
|
||||||
|
break;
|
||||||
|
case PM_MUSIC_ON:
|
||||||
|
case PM_MUSIC_OFF:
|
||||||
|
NewState = 1;
|
||||||
|
break;
|
||||||
|
case PM_CYBORG_OFF:
|
||||||
|
case PM_CYBORG_NORMAL:
|
||||||
|
case PM_CYBORG_DOUBLE:
|
||||||
|
case PM_CYBORG_SUPER:
|
||||||
|
NewState = 2;
|
||||||
|
break;
|
||||||
|
case PM_CHANGE_CAPTAIN:
|
||||||
|
NewState = 3;
|
||||||
|
break;
|
||||||
|
case PM_CHANGE_SHIP:
|
||||||
|
NewState = 4;
|
||||||
|
break;
|
||||||
|
case PM_EXIT_MENU4:
|
||||||
|
NewState = 5;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
r.extent.height = RADAR_HEIGHT + 11;
|
r.extent.height = RADAR_HEIGHT + 11;
|
||||||
DrawPCMenu (beg_index, end_index, (BYTE)NewState, hilite, &r);
|
DrawPCMenu (beg_index, end_index, (BYTE)NewState, hilite, &r);
|
||||||
s.frame = 0;
|
s.frame = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if(optPCmenu)
|
||||||
|
{
|
||||||
|
r.corner.x -= 1;
|
||||||
|
r.extent.width += 1;
|
||||||
|
r.extent.height = RADAR_HEIGHT + 11;
|
||||||
|
}
|
||||||
|
else
|
||||||
r.extent.height = 11;
|
r.extent.height = 11;
|
||||||
DrawFilledRectangle (&r);
|
DrawFilledRectangle (&r);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user