This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[------------------------------------------------------------------- | |
-- Platform detecting Lua initialisation code | |
-- Copyright (c) 2014 A.W. Stanley <[email protected]> | |
-- Released under the new BSD License | |
-------------------------------------------------------------------]]-- | |
local lua_dir = "lua" | |
local lua_init = "lua/server.lua" | |
-- Pull the first directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2006-2014 A.W. Stanley | |
* Released into the public domain as of | |
* http://awsta.nley.org/post/88514503005/c-steamid-conversion | |
* | |
* An assumption is made about "normal" string inputs. | |
* Note: 76561197960265728 = 0000 0001 0001 0000 0000 0000 0000 0001 | |
* Universe: (0000 0001) | |
* Account Type: (0001) | |
* Instance: (0000 0000 0000 0001) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright (c) 2014, A.W. Stanley | |
Permission to use, copy, modify, and/or distribute this software | |
for any purpose with or without fee is hereby granted, provided | |
that the above copyright notice and this permission notice appear | |
in all copies. | |
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double delta = 0.0f; | |
double time_now = glfwGetTime(); | |
double time_last = glfwGetTime(); | |
while(my_running_boolean) | |
{ | |
time_now = glfwGetTime(); | |
delta = (time_now - time_last); | |
time_last = time_now; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> // uint8_t | |
class Scene | |
{ | |
public: | |
virtual void Run() {} | |
Scene() {} | |
~Scene() {} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
// Get blocks | |
var blocks = new List<IMyTerminalBlock>(); | |
// Get the antenna | |
GridTerminalSystem.GetBlocksOfType<IMyRadioAntenna>(blocks); | |
if(blocks.Count > 0) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OnOff code seems to be global | |
ITerminalAction GetOnOffAction(IMyTerminalBlock block, bool enable) | |
{ | |
ITerminalAction Action; | |
if (enable) | |
{ | |
Action = block.GetActionWithName("Toggle block On"); | |
} | |
else | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OnOff code seems to be global... | |
ITerminalAction GetOnOffAction(IMyTerminalBlock block, bool enable) | |
{ | |
ITerminalAction Action; | |
if (enable) | |
{ | |
Action = block.GetActionWithName("Toggle block On"); | |
} | |
else | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name Syntax: "<Friendly List Alias><Cfg_Separator><Resource(s)>" | |
// Valid resources (without quotation marks): | |
// "Energetic", "Cobalt", "Gold", "Iron", | |
// "Nickel", "Platinum", "Silver", "Uranium" | |
// | |
// Divide them using the 'Cfg_Separator_Internal' value. e.g. | |
// [1] Reactor§Uranium | |
// [2] TwigglyDeFooBarDeBopDeBoop Hrm? Yes, This is quite something§Nickel,Cobalt,Gold | |
// USE: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
for (int block = 0; block < GridTerminalSystem.Blocks.Count; block++) | |
{ | |
if (GridTerminalSystem.Blocks[block] is IMyTerminalBlock) | |
{ | |
IMyTerminalBlock Block = GridTerminalSystem.Blocks[block]; | |
StringBuilder Str = new StringBuilder(); Str.Append(Block.BlockDefinition.ToString()); | |
Str.Append("[" + Block.DetailedInfo + "] "); | |
Block.SetCustomName(Str); |
OlderNewer