CleanUp
This commit is contained in:
parent
acdbd4d021
commit
7344d1003a
10 changed files with 554 additions and 553 deletions
|
@ -73,8 +73,8 @@ static ButtonAction* UnitButtonTable[MAX_BUTTONS];
|
|||
/// buttons in UnitButtonTable
|
||||
static int NumUnitButtons;
|
||||
|
||||
ButtonAction* CurrentButtons; /// Pointer to current buttons
|
||||
static ButtonAction* _current_buttons; /// FIXME: this is just for test
|
||||
ButtonAction* CurrentButtons; ///< Pointer to current buttons
|
||||
static ButtonAction* _current_buttons; ///< FIXME: this is just for test
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Functions
|
||||
|
@ -580,8 +580,8 @@ void UpdateButtonPanel(void)
|
|||
for (z = 0; z < NumUnitButtons; ++z) {
|
||||
int pos; // keep position, modified if alt-buttons required
|
||||
// FIXME: we have to check and if these unit buttons are available
|
||||
// i.e. if button action is ButtonTrain for example check if
|
||||
// required unit is not restricted etc...
|
||||
// i.e. if button action is ButtonTrain for example check if
|
||||
// required unit is not restricted etc...
|
||||
|
||||
buttonaction = UnitButtonTable[z];
|
||||
pos = buttonaction->Pos;
|
||||
|
@ -591,7 +591,7 @@ void UpdateButtonPanel(void)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (pos > TheUI.NumButtonButtons) { // VLADI: this allows alt-buttons
|
||||
if (pos > TheUI.NumButtonButtons) { // VLADI: this allows alt-buttons
|
||||
if (KeyModifiers & ModifierAlt) {
|
||||
// buttons with pos >TheUI.NumButtonButtons are shown on if ALT is pressed
|
||||
pos -= TheUI.NumButtonButtons;
|
||||
|
@ -756,7 +756,7 @@ void DoButtonButtonClicked(int button)
|
|||
}
|
||||
for (i = 0; i < NumSelected; ++i) {
|
||||
if (Selected[i]->AutoCastSpell[spellId] != autocast) {
|
||||
SendCommandAutoSpellCast(Selected[i],
|
||||
SendCommandAutoSpellCast(Selected[i],
|
||||
spellId, autocast);
|
||||
}
|
||||
}
|
||||
|
@ -765,7 +765,7 @@ void DoButtonButtonClicked(int button)
|
|||
GameCursor = TheUI.YellowHair.Cursor;
|
||||
CursorAction = CurrentButtons[button].Action;
|
||||
CursorValue = CurrentButtons[button].Value;
|
||||
CurrentButtonLevel = 9; // level 9 is cancel-only
|
||||
CurrentButtonLevel = 9; // level 9 is cancel-only
|
||||
UpdateButtonPanel();
|
||||
SetStatusLine("Select Target");
|
||||
}
|
||||
|
@ -835,7 +835,7 @@ void DoButtonButtonClicked(int button)
|
|||
ClearCosts();
|
||||
CursorBuilding = type;
|
||||
// FIXME: check is this =9 necessary?
|
||||
CurrentButtonLevel = 9; // level 9 is cancel-only
|
||||
CurrentButtonLevel = 9; // level 9 is cancel-only
|
||||
UpdateButtonPanel();
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -149,7 +149,7 @@ int ButtonCheckUnitsAnd(const Unit* unit, const ButtonAction* button)
|
|||
**
|
||||
** @return True if enabled.
|
||||
**
|
||||
** NOTE: this check could also be moved into intialisation.
|
||||
** @note: this check could also be moved into intialisation.
|
||||
*/
|
||||
int ButtonCheckNetwork(const Unit* unit __attribute__((unused)),
|
||||
const ButtonAction* button __attribute__((unused)))
|
||||
|
@ -165,7 +165,7 @@ int ButtonCheckNetwork(const Unit* unit __attribute__((unused)),
|
|||
**
|
||||
** @return True if disabled.
|
||||
**
|
||||
** NOTE: this check could also be moved into intialisation.
|
||||
** @note: this check could also be moved into intialisation.
|
||||
*/
|
||||
int ButtonCheckNoNetwork(const Unit* unit __attribute__((unused)),
|
||||
const ButtonAction* button __attribute__((unused)))
|
||||
|
|
|
@ -56,17 +56,17 @@
|
|||
*/
|
||||
char** IconWcNames;
|
||||
|
||||
static Icon** Icons; /// Table of all icons.
|
||||
static int NumIcons; /// Number of icons in Icons.
|
||||
static Icon** Icons; ///< Table of all icons.
|
||||
static int NumIcons; ///< Number of icons in Icons.
|
||||
|
||||
static char** IconAliases; /// Table of all aliases for icons.
|
||||
static int NumIconAliases; /// Number of icons aliases in Aliases.
|
||||
static char** IconAliases; ///< Table of all aliases for icons.
|
||||
static int NumIconAliases; ///< Number of icons aliases in Aliases.
|
||||
|
||||
#ifdef DOXYGEN // no real code, only for document
|
||||
#ifdef DOXYGEN // no real code, only for document
|
||||
|
||||
static IconFile* IconFileHash[61]; /// lookup table for icon file names
|
||||
static IconFile* IconFileHash[61]; ///< lookup table for icon file names
|
||||
|
||||
static Icon* IconHash[61]; /// lookup table for icon names
|
||||
static Icon* IconHash[61]; ///< lookup table for icon names
|
||||
|
||||
#else
|
||||
|
||||
|
|
|
@ -67,20 +67,20 @@
|
|||
-- Variables
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
static int SavedMapPositionX[4]; /// Saved map position X
|
||||
static int SavedMapPositionY[4]; /// Saved map position Y
|
||||
static char Input[80]; /// line input for messages/long commands
|
||||
static int InputIndex; /// current index into input
|
||||
static char InputStatusLine[99]; /// Last input status line
|
||||
char* UiGroupKeys = "0123456789`"; /// Up to 11 keys, last unselect. Default for qwerty
|
||||
char GameRunning; /// Current running state
|
||||
char GamePaused; /// Current pause state
|
||||
char GameObserve; /// Observe mode
|
||||
char SkipGameCycle; /// Skip the next game cycle
|
||||
char BigMapMode; /// Show only the map
|
||||
enum _iface_state_ InterfaceState; /// Current interface state
|
||||
int GodMode; /// Invincibility cheat
|
||||
enum _key_state_ KeyState; /// current key state
|
||||
static int SavedMapPositionX[4]; ///< Saved map position X
|
||||
static int SavedMapPositionY[4]; ///< Saved map position Y
|
||||
static char Input[80]; ///< line input for messages/long commands
|
||||
static int InputIndex; ///< current index into input
|
||||
static char InputStatusLine[99]; ///< Last input status line
|
||||
char* UiGroupKeys = "0123456789`"; ///< Up to 11 keys, last unselect. Default for qwerty
|
||||
char GameRunning; ///< Current running state
|
||||
char GamePaused; ///< Current pause state
|
||||
char GameObserve; ///< Observe mode
|
||||
char SkipGameCycle; ///< Skip the next game cycle
|
||||
char BigMapMode; ///< Show only the map
|
||||
enum _iface_state_ InterfaceState; ///< Current interface state
|
||||
int GodMode; ///< Invincibility cheat
|
||||
enum _key_state_ KeyState; ///< current key state
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Functions
|
||||
|
@ -662,8 +662,8 @@ static int CommandKey(int key)
|
|||
break;
|
||||
|
||||
case 'p' & 0x1F:
|
||||
case 'p': // If pause-key didn't work
|
||||
case 'P': // CTRL-P, ALT-P Toggle pause
|
||||
case 'p': // If pause-key didn't work
|
||||
case 'P': // CTRL-P, ALT-P Toggle pause
|
||||
if (!(KeyModifiers & (ModifierAlt | ModifierControl))) {
|
||||
break;
|
||||
}
|
||||
|
@ -677,7 +677,7 @@ static int CommandKey(int key)
|
|||
|
||||
case KeyCodeF2:
|
||||
case KeyCodeF3:
|
||||
case KeyCodeF4: // Set/Goto place
|
||||
case KeyCodeF4: // Set/Goto place
|
||||
if (KeyModifiers & ModifierShift) {
|
||||
UiSaveMapPosition(key - KeyCodeF1);
|
||||
} else {
|
||||
|
@ -686,7 +686,7 @@ static int CommandKey(int key)
|
|||
break;
|
||||
|
||||
case 'm':
|
||||
case 'M': // ALT+M, F10 Game menu
|
||||
case 'M': // ALT+M, F10 Game menu
|
||||
if (KeyModifiers & ModifierControl) {
|
||||
UiToggleMusic();
|
||||
SavePreferences();
|
||||
|
@ -696,49 +696,49 @@ static int CommandKey(int key)
|
|||
break;
|
||||
}
|
||||
|
||||
case KeyCodeF5: // Options menu
|
||||
case KeyCodeF5: // Options menu
|
||||
if (KeyState != KeyStateInput) {
|
||||
UiEnterOptionsMenu();
|
||||
}
|
||||
break;
|
||||
|
||||
case KeyCodeF7: // Sound Options menu
|
||||
case KeyCodeF7: // Sound Options menu
|
||||
if (KeyState != KeyStateInput) {
|
||||
UiEnterSoundOptionsMenu();
|
||||
}
|
||||
break;
|
||||
|
||||
case KeyCodeF8: // Speed Options menu
|
||||
case KeyCodeF8: // Speed Options menu
|
||||
if (KeyState != KeyStateInput) {
|
||||
UiEnterSpeedOptionsMenu();
|
||||
}
|
||||
break;
|
||||
|
||||
case KeyCodeF9: // Preferences menu
|
||||
case KeyCodeF9: // Preferences menu
|
||||
if (KeyState != KeyStateInput) {
|
||||
UiEnterPreferencesOptionsMenu();
|
||||
}
|
||||
break;
|
||||
|
||||
case KeyCodeF10: // Game Options menu
|
||||
case KeyCodeF10: // Game Options menu
|
||||
if (KeyState != KeyStateInput) {
|
||||
UiEnterMenu();
|
||||
}
|
||||
break;
|
||||
|
||||
case '+': // + Faster
|
||||
case '+': // + Faster
|
||||
case '=': // plus is shift-equals.
|
||||
case KeyCodeKPPlus:
|
||||
UiIncreaseGameSpeed();
|
||||
break;
|
||||
|
||||
case '-': // - Slower
|
||||
case '-': // - Slower
|
||||
case KeyCodeKPMinus:
|
||||
UiDecreaseGameSpeed();
|
||||
break;
|
||||
|
||||
case 'l' & 0x1F:
|
||||
case 'l': // ALT l F12 load game menu
|
||||
case 'l': // ALT l F12 load game menu
|
||||
case 'L':
|
||||
#ifdef DEBUG
|
||||
if (KeyModifiers & ModifierControl) {// Ctrl + L - load - all debug
|
||||
|
@ -754,12 +754,12 @@ static int CommandKey(int key)
|
|||
UiEnterLoadGameMenu();
|
||||
break;
|
||||
|
||||
case 's' & 0x1F: // Ctrl + S - Turn sound on / off
|
||||
case 's' & 0x1F: // Ctrl + S - Turn sound on / off
|
||||
UiToggleSound();
|
||||
SavePreferences();
|
||||
break;
|
||||
|
||||
case 's': // ALT s F11 save game menu
|
||||
case 's': // ALT s F11 save game menu
|
||||
case 'S':
|
||||
if (KeyModifiers & ModifierControl) {
|
||||
UiToggleSound();
|
||||
|
@ -775,7 +775,7 @@ static int CommandKey(int key)
|
|||
|
||||
case 't' & 0x1F:
|
||||
case 't':
|
||||
case 'T': // ALT-T, CTRL-T Track unit
|
||||
case 'T': // ALT-T, CTRL-T Track unit
|
||||
if (!(KeyModifiers & (ModifierAlt | ModifierControl))) {
|
||||
break;
|
||||
}
|
||||
|
@ -784,21 +784,21 @@ static int CommandKey(int key)
|
|||
|
||||
case 'b' & 0x1F:
|
||||
case 'b':
|
||||
case 'B': // ALT+B, CTRL+B Toggle big map
|
||||
case 'B': // ALT+B, CTRL+B Toggle big map
|
||||
if (!(KeyModifiers & (ModifierAlt | ModifierControl))) {
|
||||
break;
|
||||
}
|
||||
UiToggleBigMap();
|
||||
break;
|
||||
|
||||
case 'c': // CTRL+C,ALT+C, C center on units
|
||||
case 'c': // CTRL+C,ALT+C, C center on units
|
||||
case 'C':
|
||||
UiCenterOnSelected();
|
||||
break;
|
||||
|
||||
case 'f' & 0x1F:
|
||||
case 'f':
|
||||
case 'F': // ALT+F, CTRL+F toggle fullscreen
|
||||
case 'F': // ALT+F, CTRL+F toggle fullscreen
|
||||
if (!(KeyModifiers & (ModifierAlt | ModifierControl))) {
|
||||
break;
|
||||
}
|
||||
|
@ -808,7 +808,7 @@ static int CommandKey(int key)
|
|||
|
||||
case 'g' & 0x1F:
|
||||
case 'g':
|
||||
case 'G': // ALT+G, CTRL+G grab mouse pointer
|
||||
case 'G': // ALT+G, CTRL+G grab mouse pointer
|
||||
if (!(KeyModifiers & (ModifierAlt | ModifierControl))) {
|
||||
break;
|
||||
}
|
||||
|
@ -817,20 +817,20 @@ static int CommandKey(int key)
|
|||
|
||||
case 'h' & 0x1F:
|
||||
case 'h':
|
||||
case 'H': // ALT+H, CTRL+H Help menu
|
||||
case 'H': // ALT+H, CTRL+H Help menu
|
||||
if (!(KeyModifiers & (ModifierAlt | ModifierControl))) {
|
||||
break;
|
||||
}
|
||||
UiEnterHelpMenu();
|
||||
break;
|
||||
|
||||
case ' ': // center on last action
|
||||
case ' ': // center on last action
|
||||
CenterOnMessage();
|
||||
break;
|
||||
|
||||
case '\t': // TAB toggles minimap.
|
||||
// FIXME: more...
|
||||
// FIXME: shift+TAB
|
||||
case '\t': // TAB toggles minimap.
|
||||
// FIXME: more...
|
||||
// FIXME: shift+TAB
|
||||
if (KeyModifiers & ModifierAlt) {
|
||||
break;
|
||||
}
|
||||
|
@ -839,7 +839,7 @@ static int CommandKey(int key)
|
|||
|
||||
case 'x' & 0x1F:
|
||||
case 'x':
|
||||
case 'X': // ALT+X, CTRL+X: Exit game
|
||||
case 'X': // ALT+X, CTRL+X: Exit game
|
||||
if (!(KeyModifiers & (ModifierAlt | ModifierControl))) {
|
||||
break;
|
||||
}
|
||||
|
@ -848,7 +848,7 @@ static int CommandKey(int key)
|
|||
|
||||
case 'q' & 0x1F:
|
||||
case 'q':
|
||||
case 'Q': // ALT+Q, CTRL+Q: Quit level
|
||||
case 'Q': // ALT+Q, CTRL+Q: Quit level
|
||||
if (!(KeyModifiers & (ModifierAlt | ModifierControl))) {
|
||||
break;
|
||||
}
|
||||
|
@ -857,7 +857,7 @@ static int CommandKey(int key)
|
|||
|
||||
case 'r' & 0x1F:
|
||||
case 'r':
|
||||
case 'R': // ALT+R, CTRL+R: Restart scenario
|
||||
case 'R': // ALT+R, CTRL+R: Restart scenario
|
||||
if (!(KeyModifiers & (ModifierAlt | ModifierControl))) {
|
||||
break;
|
||||
}
|
||||
|
@ -870,11 +870,11 @@ static int CommandKey(int key)
|
|||
break;
|
||||
}
|
||||
// FALL THROUGH
|
||||
case '.': // ., ALT+I, CTRL+I: Find idle worker
|
||||
case '.': // ., ALT+I, CTRL+I: Find idle worker
|
||||
UiFindIdleWorker();
|
||||
break;
|
||||
|
||||
case 'v': // ALT+v CTRL+V: Viewport
|
||||
case 'v': // ALT+v CTRL+V: Viewport
|
||||
if (KeyModifiers & ModifierControl) {
|
||||
CycleViewportMode(-1);
|
||||
} else {
|
||||
|
@ -1118,7 +1118,7 @@ int HandleKeyModifiersDown(unsigned key, unsigned keychar
|
|||
KeyModifiers |= ModifierAlt;
|
||||
// maxy: disabled
|
||||
if (InterfaceState == IfaceStateNormal) {
|
||||
SelectedUnitChanged(); // VLADI: to allow alt-buttons
|
||||
SelectedUnitChanged(); // VLADI: to allow alt-buttons
|
||||
}
|
||||
return 1;
|
||||
case KeyCodeSuper:
|
||||
|
@ -1354,8 +1354,8 @@ void HandleButtonDown(unsigned button)
|
|||
/**
|
||||
** Called if mouse button released.
|
||||
**
|
||||
** FIXME: the mouse handling should be complete rewritten
|
||||
** FIXME: this is needed for double click, long click,...
|
||||
** @todo FIXME: the mouse handling should be complete rewritten
|
||||
** @todo FIXME: this is needed for double click, long click,...
|
||||
**
|
||||
** @param button Mouse button number (0 left, 1 middle, 2 right)
|
||||
*/
|
||||
|
@ -1368,19 +1368,19 @@ void HandleButtonUp(unsigned button)
|
|||
-- Lowlevel input functions
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
int DoubleClickDelay = 300; /// Time to detect double clicks.
|
||||
int HoldClickDelay = 1000; /// Time to detect hold clicks.
|
||||
int DoubleClickDelay = 300; ///< Time to detect double clicks.
|
||||
int HoldClickDelay = 1000; ///< Time to detect hold clicks.
|
||||
|
||||
static enum {
|
||||
InitialMouseState, /// start state
|
||||
ClickedMouseState, /// button is clicked
|
||||
} MouseState; /// Current state of mouse
|
||||
InitialMouseState, ///< start state
|
||||
ClickedMouseState, ///< button is clicked
|
||||
} MouseState; ///< Current state of mouse
|
||||
|
||||
static int MouseX; /// Last mouse X position
|
||||
static int MouseY; /// Last mouse Y position
|
||||
static unsigned LastMouseButton; /// last mouse button handled
|
||||
static unsigned StartMouseTicks; /// Ticks of first click
|
||||
static unsigned LastMouseTicks; /// Ticks of last mouse event
|
||||
static int MouseX; ///< Last mouse X position
|
||||
static int MouseY; ///< Last mouse Y position
|
||||
static unsigned LastMouseButton; ///< last mouse button handled
|
||||
static unsigned StartMouseTicks; ///< Ticks of first click
|
||||
static unsigned LastMouseTicks; ///< Ticks of last mouse event
|
||||
|
||||
/**
|
||||
** Called if any mouse button is pressed down
|
||||
|
@ -1515,12 +1515,12 @@ void InputMouseTimeout(const EventCallback* callbacks, unsigned ticks)
|
|||
}
|
||||
|
||||
|
||||
static int HoldKeyDelay = 250; /// Time to detect hold key
|
||||
static int HoldKeyAdditionalDelay = 50; /// Time to detect additional hold key
|
||||
static int HoldKeyDelay = 250; ///< Time to detect hold key
|
||||
static int HoldKeyAdditionalDelay = 50; ///< Time to detect additional hold key
|
||||
|
||||
static unsigned LastIKey; /// last key handled
|
||||
static unsigned LastIKeyChar; /// last keychar handled
|
||||
static unsigned LastKeyTicks; /// Ticks of last key
|
||||
static unsigned LastIKey; ///< last key handled
|
||||
static unsigned LastIKeyChar; ///< last keychar handled
|
||||
static unsigned LastKeyTicks; ///< Ticks of last key
|
||||
|
||||
/**
|
||||
** Handle keyboard key press.
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
/**@name mainscr.c - The main screen. */
|
||||
//
|
||||
// (c) Copyright 1998-2004 by Lutz Sammer, Valery Shchedrin,
|
||||
// and Jimmy Salmon
|
||||
// and Jimmy Salmon
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -195,7 +195,7 @@ static void UiDrawCompletedBar(int full, int ready)
|
|||
VideoDrawVLine(ColorWhite, TheUI.CompletedBarX, TheUI.CompletedBarY, TheUI.CompletedBarH );
|
||||
VideoDrawHLine(ColorWhite, TheUI.CompletedBarX, TheUI.CompletedBarY, f );
|
||||
}
|
||||
|
||||
|
||||
if (TheUI.CompletedBarText) {
|
||||
VideoDrawText(TheUI.CompletedBarTextX, TheUI.CompletedBarTextY,
|
||||
TheUI.CompletedBarFont, TheUI.CompletedBarText);
|
||||
|
@ -522,7 +522,7 @@ static void DrawUnitInfo(const Unit* unit)
|
|||
// Non-attacking buildings.
|
||||
//
|
||||
if (type->Building && !type->CanAttack) {
|
||||
if (type->Supply) { // Supply unit
|
||||
if (type->Supply) { // Supply unit
|
||||
VideoDrawText(x + 16, y + 8 + 63, GameFont, "Usage");
|
||||
VideoDrawText(x + 58, y + 8 + 78, GameFont, "Supply:");
|
||||
VideoDrawNumber(x + 108, y + 8 + 78, GameFont, unit->Player->Supply);
|
||||
|
@ -619,7 +619,7 @@ static void DrawUnitInfo(const Unit* unit)
|
|||
// max mana can vary for the unit
|
||||
i = (100 * unit->Mana) / unit->Type->_MaxMana;
|
||||
i = (i * w) / 100;
|
||||
VideoDrawRectangleClip(ColorGray, x + 16, y + 8 + 140, w + 4, 16 );
|
||||
VideoDrawRectangleClip(ColorGray, x + 16, y + 8 + 140, w + 4, 16 );
|
||||
VideoDrawRectangleClip(ColorBlack,x + 16 + 1, y + 8 + 140 + 1, w + 2, 16 - 2);
|
||||
VideoFillRectangleClip(ColorBlue, x + 16 + 2, y + 8 + 140 + 2, i, 16 - 4);
|
||||
|
||||
|
@ -1040,9 +1040,9 @@ void ClearStatusLine(void)
|
|||
-- COSTS
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
static int CostsFood; /// mana cost to display in status line
|
||||
static int CostsMana; /// mana cost to display in status line
|
||||
static int Costs[MaxCosts]; /// costs to display in status line
|
||||
static int CostsFood; ///< mana cost to display in status line
|
||||
static int CostsMana; ///< mana cost to display in status line
|
||||
static int Costs[MaxCosts]; ///< costs to display in status line
|
||||
|
||||
/**
|
||||
** Draw costs in status line.
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
//@{
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Includes
|
||||
-- Includes
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -73,21 +73,21 @@
|
|||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Variables
|
||||
-- Variables
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
** Menu button graphics
|
||||
** Menu button graphics
|
||||
*/
|
||||
MenuGraphics MenuButtonGfx;
|
||||
|
||||
/**
|
||||
** The currently processed menu
|
||||
** The currently processed menu
|
||||
*/
|
||||
Menu* CurrentMenu;
|
||||
|
||||
/**
|
||||
** The background picture used by menus
|
||||
** The background picture used by menus
|
||||
*/
|
||||
static Graphic* Menusbgnd;
|
||||
|
||||
|
@ -95,11 +95,11 @@ static int MenuButtonUnderCursor = -1;
|
|||
static int MenuButtonCurSel = -1;
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Menu operation functions
|
||||
-- Menu operation functions
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
** Convert menu button style to a string for saving.
|
||||
** Convert menu button style to a string for saving.
|
||||
*/
|
||||
char* MenuButtonStyle(int style)
|
||||
{
|
||||
|
@ -144,11 +144,11 @@ char* MenuButtonStyle(int style)
|
|||
}
|
||||
|
||||
/**
|
||||
** Find a menu by ident.
|
||||
** Find a menu by ident.
|
||||
**
|
||||
** @param menu_id Unique identifier for the menu.
|
||||
** @param menu_id Unique identifier for the menu.
|
||||
**
|
||||
** @return Pointer to the menu, NULL if menu is not found.
|
||||
** @return Pointer to the menu, NULL if menu is not found.
|
||||
*/
|
||||
Menu* FindMenu(const char* menu_id)
|
||||
{
|
||||
|
@ -162,19 +162,19 @@ Menu* FindMenu(const char* menu_id)
|
|||
}
|
||||
|
||||
/**
|
||||
** Draw menu button 'button' on x,y
|
||||
** Draw menu button 'button' on x,y
|
||||
**
|
||||
** @param button Button identifier
|
||||
** @param flags State of Button (clicked, mouse over...)
|
||||
** @param transparent State of button transparency: 0=No, 1=Yes
|
||||
** @param w Button width (for border)
|
||||
** @param h Button height (for border)
|
||||
** @param x X display position
|
||||
** @param y Y display position
|
||||
** @param font font number for text
|
||||
** @param text text to print on button
|
||||
** @param normalcolor
|
||||
** @param reversecolor
|
||||
** @param button Button identifier
|
||||
** @param flags State of Button (clicked, mouse over...)
|
||||
** @param transparent State of button transparency: 0=No, 1=Yes
|
||||
** @param w Button width (for border)
|
||||
** @param h Button height (for border)
|
||||
** @param x X display position
|
||||
** @param y Y display position
|
||||
** @param font font number for text
|
||||
** @param text text to print on button
|
||||
** @param normalcolor FIXME : docu
|
||||
** @param reversecolor FIXME : docu
|
||||
*/
|
||||
void DrawMenuButton(MenuButtonId button, unsigned flags, int transparent, int w, int h,
|
||||
int x, int y, const int font, const unsigned char* text,
|
||||
|
@ -281,11 +281,11 @@ void DrawMenuButton(MenuButtonId button, unsigned flags, int transparent, int w,
|
|||
}
|
||||
|
||||
/**
|
||||
** Draw pulldown 'button' on menu mx, my
|
||||
** Draw pulldown 'button' on menu mx, my
|
||||
**
|
||||
** @param mi menuitem pointer
|
||||
** @param mx menu X display position (offset)
|
||||
** @param my menu Y display position (offset)
|
||||
** @param mi menuitem pointer
|
||||
** @param mx menu X display position (offset)
|
||||
** @param my menu Y display position (offset)
|
||||
*/
|
||||
static void DrawPulldown(Menuitem* mi, int mx, int my)
|
||||
{
|
||||
|
@ -532,11 +532,11 @@ static void DrawPulldown(Menuitem* mi, int mx, int my)
|
|||
}
|
||||
|
||||
/**
|
||||
** Draw listbox 'button' on menu mx, my
|
||||
** Draw listbox 'button' on menu mx, my
|
||||
**
|
||||
** @param mi menuitem pointer
|
||||
** @param mx menu X display position (offset)
|
||||
** @param my menu Y display position (offset)
|
||||
** @param mi menuitem pointer
|
||||
** @param mx menu X display position (offset)
|
||||
** @param my menu Y display position (offset)
|
||||
*/
|
||||
static void DrawListbox(Menuitem* mi, int mx, int my)
|
||||
{
|
||||
|
@ -612,11 +612,11 @@ static void DrawListbox(Menuitem* mi, int mx, int my)
|
|||
}
|
||||
|
||||
/**
|
||||
** Draw vslider 'button' on menu mx, my
|
||||
** Draw vslider 'button' on menu mx, my
|
||||
**
|
||||
** @param mi menuitem pointer
|
||||
** @param mx menu X display position (offset)
|
||||
** @param my menu Y display position (offset)
|
||||
** @param mi menuitem pointer
|
||||
** @param mx menu X display position (offset)
|
||||
** @param my menu Y display position (offset)
|
||||
*/
|
||||
static void DrawVSlider(Menuitem* mi, int mx, int my)
|
||||
{
|
||||
|
@ -715,11 +715,11 @@ static void DrawVSlider(Menuitem* mi, int mx, int my)
|
|||
}
|
||||
|
||||
/**
|
||||
** Draw hslider 'button' on menu mx, my
|
||||
** Draw hslider 'button' on menu mx, my
|
||||
**
|
||||
** @param mi menuitem pointer
|
||||
** @param mx menu X display position (offset)
|
||||
** @param my menu Y display position (offset)
|
||||
** @param mi menuitem pointer
|
||||
** @param mx menu X display position (offset)
|
||||
** @param my menu Y display position (offset)
|
||||
*/
|
||||
static void DrawHSlider(Menuitem* mi, int mx, int my)
|
||||
{
|
||||
|
@ -818,11 +818,11 @@ static void DrawHSlider(Menuitem* mi, int mx, int my)
|
|||
}
|
||||
|
||||
/**
|
||||
** Draw gem 'button' on menu mx, my
|
||||
** Draw gem 'button' on menu mx, my
|
||||
**
|
||||
** @param mi menuitem pointer
|
||||
** @param mx menu X display position (offset)
|
||||
** @param my menu Y display position (offset)
|
||||
** @param mi menuitem pointer
|
||||
** @param mx menu X display position (offset)
|
||||
** @param my menu Y display position (offset)
|
||||
*/
|
||||
static void DrawGem(Menuitem* mi, int mx, int my)
|
||||
{
|
||||
|
@ -876,11 +876,11 @@ static void DrawGem(Menuitem* mi, int mx, int my)
|
|||
}
|
||||
|
||||
/**
|
||||
** Draw input 'button' on menu mx, my
|
||||
** Draw input 'button' on menu mx, my
|
||||
**
|
||||
** @param mi menuitem pointer
|
||||
** @param mx menu X display position (offset)
|
||||
** @param my menu Y display position (offset)
|
||||
** @param mi menuitem pointer
|
||||
** @param mx menu X display position (offset)
|
||||
** @param my menu Y display position (offset)
|
||||
*/
|
||||
static void DrawInput(Menuitem* mi, int mx, int my)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ static void DrawInput(Menuitem* mi, int mx, int my)
|
|||
/**
|
||||
** Draw a menu.
|
||||
**
|
||||
** @param menu The menu number to display (NULL allowed)
|
||||
** @param menu The menu number to display (NULL allowed)
|
||||
*/
|
||||
void DrawMenu(Menu* menu)
|
||||
{
|
||||
|
@ -1075,7 +1075,7 @@ void DrawMenu(Menu* menu)
|
|||
break;
|
||||
case MI_TYPE_PULLDOWN:
|
||||
if (mi->flags & MenuButtonClicked) {
|
||||
mip = mi; // Delay, due to possible overlaying!
|
||||
mip = mi; // Delay, due to possible overlaying!
|
||||
} else {
|
||||
DrawPulldown(mi, menu->X, menu->Y);
|
||||
}
|
||||
|
@ -1111,7 +1111,7 @@ void DrawMenu(Menu* menu)
|
|||
}
|
||||
|
||||
/**
|
||||
** Paste text from the clipboard
|
||||
** Paste text from the clipboard
|
||||
*/
|
||||
static void PasteFromClipboard(Menuitem* mi)
|
||||
{
|
||||
|
@ -1203,13 +1203,13 @@ static void PasteFromClipboard(Menuitem* mi)
|
|||
}
|
||||
|
||||
/**
|
||||
** Handle keys in menu mode.
|
||||
** Handle keys in menu mode.
|
||||
**
|
||||
** @param key Key scancode.
|
||||
** @param keychar ASCII character code of key.
|
||||
** @param key Key scancode.
|
||||
** @param keychar ASCII character code of key.
|
||||
**
|
||||
** @todo FIXME: Should be MenuKeyDown(), and act on _new_ MenuKeyUp() !!!
|
||||
** to implement button animation (depress before action)
|
||||
** @todo FIXME: Should be MenuKeyDown(), and act on _new_ MenuKeyUp() !!!
|
||||
** to implement button animation (depress before action)
|
||||
*/
|
||||
static void MenuHandleKeyDown(unsigned key, unsigned keychar)
|
||||
{
|
||||
|
@ -1247,8 +1247,8 @@ inkey:
|
|||
break;
|
||||
case 9:
|
||||
goto normkey;
|
||||
case '~': // ~ are quotes
|
||||
return; // Just ignore them
|
||||
case '~': // ~ are quotes
|
||||
return; // Just ignore them
|
||||
case KeyCodeDelete:
|
||||
mi->d.input.nch = 0;
|
||||
strcpy(mi->d.input.buffer, "~!_");
|
||||
|
@ -1301,7 +1301,7 @@ normkey:
|
|||
}
|
||||
}
|
||||
switch (key) {
|
||||
case 10: case 13: // RETURN
|
||||
case 10: case 13: // RETURN
|
||||
if (MenuButtonCurSel != -1) {
|
||||
mi = menu->Items + MenuButtonCurSel;
|
||||
switch (mi->mitype) {
|
||||
|
@ -1423,7 +1423,7 @@ normkey:
|
|||
}
|
||||
}
|
||||
break;
|
||||
case 9: // TAB // FIXME: Add Shift-TAB
|
||||
case 9: // TAB // FIXME: Add Shift-TAB
|
||||
if (KeyModifiers & ModifierAlt) {
|
||||
break;
|
||||
}
|
||||
|
@ -1486,10 +1486,10 @@ normkey:
|
|||
}
|
||||
|
||||
/**
|
||||
** Handle keys in menu mode.
|
||||
** Handle keys in menu mode.
|
||||
**
|
||||
** @param key Key scancode.
|
||||
** @param keychar ASCII character code of key.
|
||||
** @param key Key scancode.
|
||||
** @param keychar ASCII character code of key.
|
||||
*/
|
||||
static void MenuHandleKeyUp(unsigned key, unsigned keychar)
|
||||
{
|
||||
|
@ -1497,10 +1497,10 @@ static void MenuHandleKeyUp(unsigned key, unsigned keychar)
|
|||
}
|
||||
|
||||
/**
|
||||
** Handle keys repeated in menu mode.
|
||||
** Handle keys repeated in menu mode.
|
||||
**
|
||||
** @param key Key scancode.
|
||||
** @param keychar ASCII character code of key.
|
||||
** @param key Key scancode.
|
||||
** @param keychar ASCII character code of key.
|
||||
*/
|
||||
static void MenuHandleKeyRepeat(unsigned key, unsigned keychar)
|
||||
{
|
||||
|
@ -1516,10 +1516,10 @@ static void MenuHandleKeyRepeat(unsigned key, unsigned keychar)
|
|||
}
|
||||
|
||||
/**
|
||||
** Handle movement of the cursor.
|
||||
** Handle movement of the cursor.
|
||||
**
|
||||
** @param x Screen X position.
|
||||
** @param y Screen Y position.
|
||||
** @param x Screen X position.
|
||||
** @param y Screen Y position.
|
||||
*/
|
||||
static void MenuHandleMouseMove(int x, int y)
|
||||
{
|
||||
|
@ -1536,7 +1536,7 @@ static void MenuHandleMouseMove(int x, int y)
|
|||
int oy;
|
||||
|
||||
ox = CursorX;
|
||||
oy = CursorY; // Old position for rel movement.
|
||||
oy = CursorY; // Old position for rel movement.
|
||||
HandleCursorMove(&x, &y);
|
||||
|
||||
if (CurrentMenu == NULL) {
|
||||
|
@ -1703,7 +1703,7 @@ static void MenuHandleMouseMove(int x, int y)
|
|||
}
|
||||
j = (y - ys) / 18;
|
||||
if (j != mi->d.listbox.cursel) {
|
||||
mi->d.listbox.cursel = j; // just store for click
|
||||
mi->d.listbox.cursel = j; // just store for click
|
||||
}
|
||||
if (mi->flags & MenuButtonClicked && mi->flags & MenuButtonActive) {
|
||||
if (mi->d.listbox.cursel != mi->d.listbox.curopt) {
|
||||
|
@ -1771,7 +1771,7 @@ static void MenuHandleMouseMove(int x, int y)
|
|||
}
|
||||
}
|
||||
if (mi->d.vslider.action) {
|
||||
(*mi->d.vslider.action)(mi, 1); // 1 indicates move
|
||||
(*mi->d.vslider.action)(mi, 1); // 1 indicates move
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1895,9 +1895,9 @@ static void MenuHandleMouseMove(int x, int y)
|
|||
}
|
||||
|
||||
/**
|
||||
** Called if mouse button pressed down.
|
||||
** Called if mouse button pressed down.
|
||||
**
|
||||
** @param b button code
|
||||
** @param b button code
|
||||
*/
|
||||
static void MenuHandleButtonDown(unsigned b __attribute__((unused)))
|
||||
{
|
||||
|
@ -1941,7 +1941,7 @@ static void MenuHandleButtonDown(unsigned b __attribute__((unused)))
|
|||
case MI_TYPE_VSLIDER:
|
||||
mi->d.vslider.cflags = mi->d.vslider.cursel;
|
||||
if (mi->d.vslider.action) {
|
||||
(*mi->d.vslider.action)(mi, 0); // 0 indicates down
|
||||
(*mi->d.vslider.action)(mi, 0); // 0 indicates down
|
||||
}
|
||||
break;
|
||||
case MI_TYPE_HSLIDER:
|
||||
|
@ -2109,9 +2109,9 @@ static void MenuHandleButtonDown(unsigned b __attribute__((unused)))
|
|||
}
|
||||
|
||||
/**
|
||||
** Called if mouse button released.
|
||||
** Called if mouse button released.
|
||||
**
|
||||
** @param b button code
|
||||
** @param b button code
|
||||
*/
|
||||
static void MenuHandleButtonUp(unsigned b)
|
||||
{
|
||||
|
@ -2241,10 +2241,10 @@ typedef struct _menu_stack_ {
|
|||
struct _menu_stack_* Next;
|
||||
} MenuStack;
|
||||
|
||||
MenuStack* Menus;
|
||||
MenuStack* Menus; ///< FIXME : docu
|
||||
|
||||
/**
|
||||
** Push the current menu onto the stack.
|
||||
** Push the current menu onto the stack.
|
||||
*/
|
||||
static void PushMenu(void)
|
||||
{
|
||||
|
@ -2258,7 +2258,7 @@ static void PushMenu(void)
|
|||
}
|
||||
|
||||
/**
|
||||
** Pop the stack and set the current menu
|
||||
** Pop the stack and set the current menu
|
||||
*/
|
||||
static void PopMenu(void)
|
||||
{
|
||||
|
@ -2270,7 +2270,7 @@ static void PopMenu(void)
|
|||
for (i = 0; i < CurrentMenu->NumItems; ++i) {
|
||||
mi = CurrentMenu->Items + i;
|
||||
if (mi->exitfunc) {
|
||||
(*mi->exitfunc)(mi); // action/destructor
|
||||
(*mi->exitfunc)(mi); // action/destructor
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2308,12 +2308,12 @@ void EndMenu(void)
|
|||
}
|
||||
|
||||
/**
|
||||
** Process a menu.
|
||||
** Process a menu.
|
||||
**
|
||||
** @param menu_id The menu number to process
|
||||
** @param loop Indicates to setup handlers and really 'Process'
|
||||
** @param menu_id The menu number to process
|
||||
** @param loop Indicates to setup handlers and really 'Process'
|
||||
**
|
||||
** @todo FIXME: This function is called from the event handler!!
|
||||
** @todo FIXME: This function is called from the event handler!!
|
||||
*/
|
||||
void ProcessMenu(const char* menu_id, int loop)
|
||||
{
|
||||
|
@ -2407,7 +2407,7 @@ void ProcessMenu(const char* menu_id, int loop)
|
|||
|
||||
if (loop) {
|
||||
SetVideoSync();
|
||||
MenuHandleMouseMove(CursorX,CursorY); // This activates buttons as appropriate!
|
||||
MenuHandleMouseMove(CursorX,CursorY); // This activates buttons as appropriate!
|
||||
}
|
||||
|
||||
if (loop) {
|
||||
|
@ -2443,7 +2443,7 @@ void ProcessMenu(const char* menu_id, int loop)
|
|||
for (i = 0; i < menu->NumItems; ++i) {
|
||||
mi = menu->Items + i;
|
||||
if (mi->exitfunc) {
|
||||
(*mi->exitfunc)(mi); // action/destructor
|
||||
(*mi->exitfunc)(mi); // action/destructor
|
||||
}
|
||||
}
|
||||
CurrentMenu = CurrentMenuSave;
|
||||
|
@ -2461,7 +2461,7 @@ void ProcessMenu(const char* menu_id, int loop)
|
|||
/**
|
||||
** Init Menus for a specific race
|
||||
**
|
||||
** @param race The Race to set-up for
|
||||
** @param race The Race to set-up for
|
||||
*/
|
||||
void InitMenus(int race)
|
||||
{
|
||||
|
@ -2474,7 +2474,7 @@ void InitMenus(int race)
|
|||
InitMenuData();
|
||||
|
||||
#ifndef USE_OPENGL
|
||||
if (race == last_race) { // same race? already loaded!
|
||||
if (race == last_race) { // same race? already loaded!
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@ -2504,7 +2504,7 @@ void InitMenus(int race)
|
|||
}
|
||||
|
||||
/**
|
||||
** Exit Menus code (freeing data)
|
||||
** Exit Menus code (freeing data)
|
||||
*/
|
||||
void ExitMenus(void)
|
||||
{
|
||||
|
@ -2513,3 +2513,5 @@ void ExitMenus(void)
|
|||
Menusbgnd = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//@}
|
||||
|
|
666
src/ui/menus.cpp
666
src/ui/menus.cpp
File diff suppressed because it is too large
Load diff
|
@ -66,18 +66,18 @@
|
|||
-- Variables
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
enum _mouse_buttons_ MouseButtons;/// Current pressed mouse buttons
|
||||
enum _mouse_buttons_ MouseButtons; ///< Current pressed mouse buttons
|
||||
|
||||
enum _key_modifiers_ KeyModifiers;/// Current keyboard modifiers
|
||||
enum _key_modifiers_ KeyModifiers; ///< Current keyboard modifiers
|
||||
|
||||
Unit* UnitUnderCursor; /// Unit under cursor
|
||||
int ButtonAreaUnderCursor = -1; /// Button area under cursor
|
||||
int ButtonUnderCursor = -1; /// Button under cursor
|
||||
char GameMenuButtonClicked; /// Menu button was clicked
|
||||
char GameDiplomacyButtonClicked; /// Diplomacy button was clicked
|
||||
char LeaveStops; /// Mouse leaves windows stops scroll
|
||||
Unit* UnitUnderCursor; ///< Unit under cursor
|
||||
int ButtonAreaUnderCursor = -1; ///< Button area under cursor
|
||||
int ButtonUnderCursor = -1; ///< Button under cursor
|
||||
char GameMenuButtonClicked; ///< Menu button was clicked
|
||||
char GameDiplomacyButtonClicked; ///< Diplomacy button was clicked
|
||||
char LeaveStops; ///< Mouse leaves windows stops scroll
|
||||
|
||||
enum _cursor_on_ CursorOn = CursorOnUnknown; /// Cursor on field
|
||||
enum _cursor_on_ CursorOn = CursorOnUnknown; ///< Cursor on field
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Functions
|
||||
|
@ -567,7 +567,7 @@ static void HandleMouseOn(int x, int y)
|
|||
|
||||
/**
|
||||
** Handle cursor exits the game window (only for some videomodes)
|
||||
** FIXME: make it so that the game is partially 'paused'.
|
||||
** @todo FIXME: make it so that the game is partially 'paused'.
|
||||
** Game should run (for network play), but not react on or show
|
||||
** interactive events.
|
||||
*/
|
||||
|
@ -1118,7 +1118,7 @@ static int SendSpellCast(int sx, int sy)
|
|||
|
||||
dest = UnitUnderCursor;
|
||||
|
||||
/* NOTE: Vladi:
|
||||
/* NOTE: Vladi:
|
||||
This is a high-level function, it sends target spot and unit
|
||||
(if exists). All checks are performed at spell cast handle
|
||||
function which will cancel function if cannot be executed
|
||||
|
@ -1506,7 +1506,7 @@ void UIHandleButtonDown(unsigned button)
|
|||
if (UnitUnderCursor && (unit = UnitOnMapTile(x, y)) &&
|
||||
!UnitUnderCursor->Type->Decoration) {
|
||||
unit->Blink = 4; // if right click on building -- blink
|
||||
} else { // if not not click on building -- green cross
|
||||
} else { // if not not click on building -- green cross
|
||||
if (ClickMissile) {
|
||||
MakeLocalMissile(MissileTypeByIdent(ClickMissile),
|
||||
TheUI.MouseViewport->MapX * TileSizeX +
|
||||
|
@ -1542,7 +1542,7 @@ void UIHandleButtonDown(unsigned button)
|
|||
//
|
||||
} else if (CursorOn == CursorOnButton) {
|
||||
//
|
||||
// clicked on info panel - selection shown
|
||||
// clicked on info panel - selection shown
|
||||
//
|
||||
if (NumSelected > 1 && ButtonAreaUnderCursor == ButtonAreaSelected) {
|
||||
DoSelectionButtons(ButtonUnderCursor, button);
|
||||
|
@ -1721,11 +1721,11 @@ void UIHandleButtonUp(unsigned button)
|
|||
// FIXME: must selecting! (lokh: what does this mean? is this done now?)
|
||||
|
||||
// SHIFT toggles select/unselect a single unit and
|
||||
// add the content of the rectangle to the selectection
|
||||
// add the content of the rectangle to the selectection
|
||||
// ALT takes group of unit
|
||||
// CTRL takes all units of same type (st*rcr*ft)
|
||||
if (CursorState == CursorStateRectangle &&
|
||||
!(MouseButtons & LeftButton)) { // leave select mode
|
||||
!(MouseButtons & LeftButton)) { // leave select mode
|
||||
int num;
|
||||
Unit* unit;
|
||||
|
||||
|
@ -1888,7 +1888,7 @@ static int GetPieUnderCursor(void)
|
|||
y = CursorY - (CursorStartY - ICON_SIZE_Y / 2);
|
||||
for (i = 0; i < 8; ++i) {
|
||||
if (x > TheUI.PieX[i] && x < TheUI.PieX[i] + ICON_SIZE_X &&
|
||||
y > TheUI.PieY[i] && y < TheUI.PieY[i] + ICON_SIZE_Y) {
|
||||
y > TheUI.PieY[i] && y < TheUI.PieY[i] + ICON_SIZE_Y) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
@ -1909,7 +1909,7 @@ void DrawPieMenu(void)
|
|||
if (CursorState != CursorStatePieMenu)
|
||||
return;
|
||||
|
||||
if (!(buttons = CurrentButtons)) { // no buttons
|
||||
if (!(buttons = CurrentButtons)) { // no buttons
|
||||
CursorState = CursorStatePoint;
|
||||
return;
|
||||
}
|
||||
|
@ -1936,7 +1936,7 @@ void DrawPieMenu(void)
|
|||
// Draw icon
|
||||
DrawIcon(player, buttons[i].Icon.Icon, x, y);
|
||||
|
||||
// Tutorial show command key in icons
|
||||
// Tutorial show command key in icons
|
||||
if (ShowCommandKey) {
|
||||
char* text;
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
//@{
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Includes
|
||||
-- Includes
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -53,15 +53,15 @@
|
|||
----------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
char* ClickMissile;
|
||||
char* DamageMissile;
|
||||
char* ClickMissile; ///< FIXME:docu
|
||||
char* DamageMissile; ///< FIXME:docu
|
||||
|
||||
typedef struct _info_text_ {
|
||||
char* Text;
|
||||
int Font;
|
||||
int X;
|
||||
int Y;
|
||||
} InfoText;
|
||||
char* Text; ///< FIXME:docu
|
||||
int Font; ///< FIXME:docu
|
||||
int X; ///< FIXME:docu
|
||||
int Y; ///< FIXME:docu
|
||||
} InfoText; ///< FIXME:docu
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Functions
|
||||
|
@ -1116,7 +1116,7 @@ static int CclDefineUI(lua_State* l)
|
|||
j = 0;
|
||||
args = lua_gettop(l);
|
||||
|
||||
// Get identifier
|
||||
// Get identifier
|
||||
str = strdup(LuaToString(l, j + 1));
|
||||
++j;
|
||||
x = LuaToNumber(l, j + 1);
|
||||
|
@ -1153,7 +1153,7 @@ static int CclDefineUI(lua_State* l)
|
|||
ui->Height = y;
|
||||
|
||||
//
|
||||
// Some value defaults
|
||||
// Some value defaults
|
||||
//
|
||||
|
||||
// This save the setup values FIXME: They are set by CCL.
|
||||
|
@ -1193,7 +1193,7 @@ static int CclDefineUI(lua_State* l)
|
|||
ui->Resources[i].TextX = -1;
|
||||
}
|
||||
//
|
||||
// Parse the arguments, already the new tagged format.
|
||||
// Parse the arguments, already the new tagged format.
|
||||
// maxy: this could be much simpler
|
||||
//
|
||||
|
||||
|
@ -2041,7 +2041,7 @@ static int CclDefineUI(lua_State* l)
|
|||
lua_pop(l, 1);
|
||||
}
|
||||
} else if (!strcmp(value, "victory-background")) {
|
||||
// Backgrounds
|
||||
// Backgrounds
|
||||
ui->VictoryBackground.File = strdup(LuaToString(l, j + 1));
|
||||
} else if (!strcmp(value, "defeat-background")) {
|
||||
ui->DefeatBackground.File = strdup(LuaToString(l, j + 1));
|
||||
|
@ -2325,7 +2325,7 @@ static int CclDefineMenu(lua_State* l)
|
|||
TheUI.Offset480Y = (VideoHeight - 480) / 2;
|
||||
|
||||
//
|
||||
// Parse the arguments, already the new tagged format.
|
||||
// Parse the arguments, already the new tagged format.
|
||||
//
|
||||
memset(&item, 0, sizeof(Menu));
|
||||
|
||||
|
@ -2546,7 +2546,7 @@ static int CclDefineMenuItem(lua_State* l)
|
|||
item = (Menuitem*)calloc(1, sizeof(Menuitem));
|
||||
|
||||
//
|
||||
// Parse the arguments, already the new tagged format.
|
||||
// Parse the arguments, already the new tagged format.
|
||||
//
|
||||
args = lua_gettop(l);
|
||||
for (j = 0; j < args; ++j) {
|
||||
|
@ -3507,7 +3507,7 @@ static int CclDefineButton(lua_State* l)
|
|||
|
||||
memset(&ba, 0, sizeof(ba));
|
||||
//
|
||||
// Parse the arguments
|
||||
// Parse the arguments
|
||||
//
|
||||
lua_pushnil(l);
|
||||
while (lua_next(l, 1)) {
|
||||
|
@ -4146,7 +4146,7 @@ void UserInterfaceCclRegister(void)
|
|||
lua_register(Lua, "DefineMenuGraphics", CclDefineMenuGraphics);
|
||||
|
||||
//
|
||||
// Color cycling
|
||||
// Color cycling
|
||||
//
|
||||
lua_register(Lua, "SetColorWaterCycleStart", CclSetColorWaterCycleStart);
|
||||
lua_register(Lua, "SetColorWaterCycleEnd", CclSetColorWaterCycleEnd);
|
||||
|
@ -4156,13 +4156,13 @@ void UserInterfaceCclRegister(void)
|
|||
lua_register(Lua, "SetColorBuildingCycleEnd", CclSetColorBuildingCycleEnd);
|
||||
|
||||
//
|
||||
// Correct named functions
|
||||
// Correct named functions
|
||||
//
|
||||
lua_register(Lua, "SetDoubleClickDelay", CclSetDoubleClickDelay);
|
||||
lua_register(Lua, "SetHoldClickDelay", CclSetHoldClickDelay);
|
||||
|
||||
//
|
||||
// Look and feel of units
|
||||
// Look and feel of units
|
||||
//
|
||||
lua_register(Lua, "SetSelectionStyle", CclSetSelectionStyle);
|
||||
lua_register(Lua, "SetShowSightRange", CclSetShowSightRange);
|
||||
|
@ -4171,7 +4171,7 @@ void UserInterfaceCclRegister(void)
|
|||
lua_register(Lua, "SetShowOrders", CclSetShowOrders);
|
||||
|
||||
//
|
||||
// Keystroke helps
|
||||
// Keystroke helps
|
||||
//
|
||||
lua_register(Lua, "ResetKeystrokeHelp", CclResetKeystrokeHelp);
|
||||
lua_register(Lua, "AddKeystrokeHelp", CclAddKeystrokeHelp);
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
//@{
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Includes
|
||||
-- Includes
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -48,16 +48,15 @@
|
|||
#include "menus.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Variables
|
||||
-- Variables
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
char RightButtonAttacks; /// right button 0 move, 1 attack
|
||||
char FancyBuildings; /// Mirror buildings 1 yes, 0 now.
|
||||
char RightButtonAttacks; ///< right button 0 move, 1 attack
|
||||
char FancyBuildings; ///< Mirror buildings 1 yes, 0 now.
|
||||
|
||||
/// keyboard scroll speed
|
||||
int SpeedKeyScroll = KEY_SCROLL_SPEED;
|
||||
/// mouse scroll speed
|
||||
int SpeedMouseScroll = MOUSE_SCROLL_SPEED;
|
||||
|
||||
int SpeedKeyScroll = KEY_SCROLL_SPEED; ///< keyboard scroll speed
|
||||
int SpeedMouseScroll = MOUSE_SCROLL_SPEED; ///< mouse scroll speed
|
||||
|
||||
/**
|
||||
** The user interface configuration
|
||||
|
@ -70,7 +69,7 @@ UI TheUI;
|
|||
UI** UI_Table;
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Functions
|
||||
-- Functions
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
static void ClipViewport(Viewport* vp, int ClipX, int ClipY);
|
||||
|
@ -787,7 +786,7 @@ void SetViewportMode(ViewportMode new_mode)
|
|||
** Cycles through predefined viewport modes (geometry configurations)
|
||||
** in order defined by the ViewportMode enumerated type.
|
||||
**
|
||||
** @param step The size of step used for cycling. Values that
|
||||
** @param step The size of step used for cycling. Values that
|
||||
** make sense are mostly 1 (next viewport mode) and
|
||||
** -1 (previous viewport mode).
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue